|
-
March 6th, 2008, 01:07 AM
#1
Wsaenobuf - 10055
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
Before post, make an effort yourself, try googling or search here.
When posting, give a proper description of your problem, include code* and error messages.
*All code should include code tags
-
March 7th, 2008, 07:02 AM
#2
Re: Wsaenobuf - 10055
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.
Regards,
Ramkrishna Pawar
-
March 7th, 2008, 07:53 AM
#3
Re: Wsaenobuf - 10055
 Originally Posted by laasunde
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.
www.monotorrent.com For all your .NET bittorrent needs
NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
-
March 9th, 2008, 01:52 PM
#4
Re: Wsaenobuf - 10055
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.
Before post, make an effort yourself, try googling or search here.
When posting, give a proper description of your problem, include code* and error messages.
*All code should include code tags
-
March 9th, 2008, 02:27 PM
#5
Re: Wsaenobuf - 10055
 Originally Posted by laasunde
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.
www.monotorrent.com For all your .NET bittorrent needs
NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
-
March 9th, 2008, 06:02 PM
#6
Re: Wsaenobuf - 10055
WSAENOBUFS needs memory from the non-paged memory pool, so adding memory won't help.
Mike
-
March 10th, 2008, 07:09 AM
#7
Re: Wsaenobuf - 10055
 Originally Posted by MikeAThon
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 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?
Last edited by laasunde; March 10th, 2008 at 09:28 AM.
Before post, make an effort yourself, try googling or search here.
When posting, give a proper description of your problem, include code* and error messages.
*All code should include code tags
-
March 10th, 2008, 07:36 AM
#8
Re: Wsaenobuf - 10055
 Originally Posted by Mutant_Fruit
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 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.
Before post, make an effort yourself, try googling or search here.
When posting, give a proper description of your problem, include code* and error messages.
*All code should include code tags
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|