Click to See Complete Forum and Search --> : Wsaenobuf - 10055
laasunde
March 6th, 2008, 12:07 AM
An .NET 1.1 C# application occationally throws a SocketException (error code 10055) when executing Socket.Listen(1024); This only seems to occur when the application uses more than 200 tcp connections.
According to MSDN, this error means; "No buffer space available. An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full."
How can I determine the actual cause of this problem? Since this error occurs on creation of a socket I dont really see how the queue can be full already. So I thought that it might be an out-of-memory problem. How can I prove that? Do I use perfmon and what counters do I use?
Thanks
Krishnaa
March 7th, 2008, 06:02 AM
This could simply be a memory limitation problem, try increasing the RAM. You can first check if memory is the problem by running it on another computer with diff. memory configuration.
Mutant_Fruit
March 7th, 2008, 06:53 AM
According to MSDN, this error means; "No buffer space available. An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full."
How can I determine the actual cause of this problem? (snip) So I thought that it might be an out-of-memory problem. How can I prove that?
The message tells you it's an out of memory exception. Googling for that socket error gives this info:
What causes this bug?
WSAENOBUFS should occur when the system has not enough memory or other system resources to open new TCP/IP socket or to handle socket data. It looks like that in most cases the problem occurs when total count of opened sockets reaches some magical number. MS writes that this limit is 3976 simultaneously opened sockets but it seems that on Win9x systems the real limit is much lower.
Proxy+ uses permanently about 10-20 opened sockets (it depends on configuration, number of defined Mapped Links,...) and each client request allocates two sockets - one for client side and one for server side of connection. Because TCP/IP system doesn't free sockets immediately when they are closed (socket remains allocated for 240 seconds after application closes it) it is possible that system will report WSAENOBUFS due to lack of free socket resources.
laasunde
March 9th, 2008, 01:52 PM
Thanks for your response.
Mutant_Fruit: The error message description seems to say either memory problem or socket problem. Viewing task manager Windows apparently has more than 200 MB of available 'physical memory'. That is why I'm wondering how I can verify whether this is in fact a memory problem or some socket problem.
Will look into adding more RAM to the computer.
Mutant_Fruit
March 9th, 2008, 02:27 PM
Will look into adding more RAM to the computer.
That won't help. Windows has a built in limit which controls the maximum amount of sockets you can have open simultaneously. That's what you're hitting.
MikeAThon
March 9th, 2008, 06:02 PM
WSAENOBUFS needs memory from the non-paged memory pool, so adding memory won't help.
Mike
laasunde
March 10th, 2008, 07:09 AM
WSAENOBUFS needs memory from the non-paged memory pool, so adding memory won't help.
Mike
Thought the size of non-paged memory was determine based several factors, including size of physical RAM. So adding more RAM could increase the size of the non-paged memory and then resolve the problem. Or am I missing something?
Using perfmon, Memory\Pool Nonpaged Bytes is roughly 41,525KB and the application in question uses 5,009KB of Nonpaged bytes. The computer itself has 1GB memory. Reading this (http://blogs.technet.com/clint_huffman/archive/2007/10/01/indentify-32-bit-kernel-memory-issues.aspx) article it appear the OS should have about 212MB of non paged memory. It does not appear like a non paged memory problem to me. What do you think?
laasunde
March 10th, 2008, 07:36 AM
That won't help. Windows has a built in limit which controls the maximum amount of sockets you can have open simultaneously. That's what you're hitting.
Do you know what the default MaxConnections is for WinXP sp2? Found this link (http://tangentsoft.net/wskfaq/advanced.html) which was quite useful. It does appear the limit is very high, using Tcp View I'm only seeing around 300-380 tcp connections in use.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.