aluncob aluncob -4 years ago 164
C Question

Windows socket error code 10055

I've developed an app that uses sockets over windows. It works perfectly but after some time, the internet connection begin to fail and finally I get this error (10055), which means that my app run out of buffer space.

Actually I think I am only using 2 sockets with the code i did by myself, but it's true that I'm using a 3rd party library that I have no idea how it's implemented.

I've read that there are lot of literature about this trouble, so I am not the only that suffers from it, but I cannot realise how to solve it, or at least, by-pass it, because when it fails, it makes my computer to lose internet connection. I've tried it by catching this error and when it occurs, doing a

even when it's not the best practise... but my app still get stacked in this error.

Any advice will be pretty much appreciated.

Answer Source

Usually this happens when you dnt close your socket properly. Make sure you have both shutdown and closesocket when you want to close the socket ( From MSDN - "Note To assure that all data is sent and received on a connection, an application should call shutdown before calling closesocket"

Before you bind the socket, you can use SO_REUSEADDR for setsocketopt which will "Allows the socket to be bound to an address that is already in use" (

Finally, look at this blog -

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download