Reputation: 4112
I've written an IP multicasting application in C#. It compiles fine, but at runtime this line:
sock.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.AddMembership,
new MulticastOption(IPAddress.Parse("224.100.0.1")));
throws an unhandled socket exception:
An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full
I searched for the error in Google and people have suggested to remove the 3GB switch (my OS is Windows 7) which may have been enabled. I did that, but still get the same error. What could be the issue?
Upvotes: 42
Views: 156595
Reputation: 3
I had the same issue and noticed that there were a lot of old/forgotten custom background processes running on the server and consuming sockets. Even the same processes run remotely by different users.
A brief cleanup via Task Manager did the job. Or reboot could be an option if you can.
Upvotes: 0
Reputation: 880
It could be port exhaustion. When application(s) makes too many outgoing connections in short time frame or does not dispose outgoing connections properly - you run out of ports.
Here is the link to rather lengthy explanation and a way to diagnose the issue
Upvotes: 24
Reputation: 70184
Got this error when contacting an external email provider in Sweden called Loopia on a Windows Server 2012 R2 Datacenter x64.
The server had not been rebooted for almost a year. After rebooting everything worked.
An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full 194.9.94.72:993
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full 194.9.94.72:993
Upvotes: 2
Reputation: 27
I've had the same issue (a.k.a error 10055) when trying to connect to a local MySQL database. I believe you need to raise the number of dynamic ports that the operating system allows.
The solution that worked for me was mentioned here I believe it may help you as well, since you are using Windows. Best of luck!
Upvotes: 2
Reputation: 51
see - http://support.microsoft.com/kb/2553549 and https://support.microsoft.com/en-us/kb/929851 (you determine how many dynamic outbout ports you want). Along with this second article, set the TcpTimedWaitDelay to dword decimal value of 30. So when sockets get released to the system, the clear faster. See - technet.microsoft.com/en-us/library/cc938217.aspx
Upvotes: 2
Reputation: 11
I had the same error on Windows Server 2008. In my case, after restart the server (with 2 years uptime) problem solved.
Upvotes: 1
Reputation: 486
This seems to happen when you run out of resources (sockets?) or memory. At the command prompt run: netstat -ab
I'm not sure off hand what the socket limit is. I'm currently fighting an issue like this myself.
Notes on socket limits: http://support.microsoft.com/kb/196271
Upvotes: 14
Reputation: 27214
You can encounter this error message if resource limits are being exceeded. A System.Net.Sockets.Socket
implements IDisposable
. Are you disposing of your socket(s) once you're finished with them?
Leaving them around for the garbage collector is an excellent way to leak resources.
Upvotes: 7
Reputation: 1632
I have this same error, but only on Windows 7. If I run my same multicast app on Vista it works. It pops up a system dialog to unblock the behavior from the app, but it runs. This is probably a changed networking permissions thing in win7. I'm still looking for a solution. If someone else finds one, please post.
Upvotes: 3