“An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full”

前端 未结 8 799
情话喂你
情话喂你 2020-12-03 02:55

I\'ve written an IP multicasting application in C#. It compiles fine, but at runtime this line:

sock.SetSocketOption(SocketOptionLevel.IP,
                          


        
相关标签:
8条回答
  • 2020-12-03 03:43

    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.

    0 讨论(0)
  • 2020-12-03 03:47

    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

    0 讨论(0)
提交回复
热议问题