Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / November 2006

Tip: Looking for answers? Try searching our database.

SocketException WSAENOBUFS on Socket.Connect

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeronimo Bertran - 23 Nov 2006 01:56 GMT
I have a client application that connects to a TCP server and uses the
Socket class.   The application connects every 10 minutes to the server and
exchanges information.  The application runs fine but we have been having a
problem after running it for several days where we receive a socket
exception when trying to connect to the server using Socket.Connect.  The
exception information is the following:

WSAENOBUFS
(10055)
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.

I suspect that the application may not be freeing some resource under some
conditions but haven't been able to find the problem.  

Is there any way to monitor these resources or resolve the problem?

Thanks

Jeronimo
"Peter Huang" [MSFT] - 23 Nov 2006 07:37 GMT
Hi Jeronimo,

Currently it is hard to narrow the problem based on my information.
As you said, this may be caused by the socket related resource is not
released.

Based on my rearch, I found many hits about this issue, but I post some for
your reference.
198663    BUG: Closesocket() on a Duplicated Socket Fails to Clean Up
http://support.microsoft.com/default.aspx?scid=kb;EN-US;198663

201213    BUG: Send() Fails with Error WSAENOBUFS Over Blocking Socket
http://support.microsoft.com/default.aspx?scid=kb;EN-US;201213

196271    When you try to connect from TCP ports greater than 5000 you receive
the error 'WSAENOBUFS (10055)'
http://support.microsoft.com/default.aspx?scid=kb;EN-US;196271

905628    You receive an error message when you run a custom Winsock network
program on a Microsoft Windows XP Service Pack 2-based computer
http://support.microsoft.com/default.aspx?scid=kb;EN-US;905628

Also I think you may try to use the TCPView tool to monitor how many TCP
connection opened from certain process(here means the client which throw
the error.
TCPView for Windows v2.4
http://www.microsoft.com/technet/sysinternals/Networking/TcpView.mspx

Also please check your code to see every 10 min, you new a socket and
connect to the remote server, afterwards, have you close the socket?
Also you may try to use the GC.AddMemoryPressure Method to suggest GC do a
garbage collect.
http://msdn2.microsoft.com/en-us/system.gc.addmemorypressure.aspx

Best regards,

Perter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

"Peter Huang" [MSFT] - 29 Nov 2006 08:13 GMT
Hi Jeronimo,

I am just checking to see how this is going.
Please drop me a quick note at your convenience to let me know the current
status of this issue.
If you have any concerns, please do not hesitate to let me know.
Thanks, and have a great day! :)

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
EmeraldShield - 23 Nov 2006 08:37 GMT
The first thing I would do it build a test app that connects and disconnects
constantly.  Not even 10 minutes. Then you can see how quickly the system
fails.  If it is always after xx number of connections then you know it is
in your cleanup code.  If it still takes days then it might be somewhere
else.

> WSAENOBUFS
> (10055)
> 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.

The only times I have seen this is when my apps were using a buffer for the
receive and never null'ing it.
Or they were never closing the socket correctly and getting the data off the
stack.  So the network stack holds all this data waiting for you to pick it
up and eventually runs out of buffer space.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.