Click to See Complete Forum and Search --> : send() 10055 socket error


prakash_bv
July 28th, 2005, 08:01 AM
I had been looking in the forums for above similar problems but nothing matches the one Iam facing. So new thread is started, Please respond

I have a VC++ application which uses TCP sockets. For some time the program is working good receiving and sending. When suddenly traffic boosts in the network with some other data packets, my send() is failing with error 10055 indicating insufficient buffer left.

Whatz the work around to eliminate the error?
(In quiet other few forums, suggestion for implementation of Non-Blocking I/0 was made. I used select, the select also fails with same error)

Please suggest what could be done for this error.

pzavolinsky
July 29th, 2005, 12:03 PM
I have a VC++ application which uses TCP sockets. For some time the program is working good receiving and sending. When suddenly traffic boosts in the network with some other data packets, my send() is failing with error 10055 indicating insufficient buffer left.

Please suggest what could be done for this error.

You can use setsockopt() to increase the buffer size for the receive buffer.


int setsockopt (
SOCKET s,
int level,
int optname,
const char FAR * optval,
int optlen
);

With:
int buffer_size = <your buffer size>

s = <the socket>
level = SOL_SOCKET
optname = SO_RCVBUF
optval = &buffer_size
optlen = sizeof(int)

Mathew Joy
August 1st, 2005, 04:33 AM
I thought I replied to this thread. Might not have clicked the reply button. :rolleyes:

The error WSAENOBUFS basically means, the system lacks resource to perform the operation. The resource mostly means the Non-paged memory. This has a fixed upper limit and is tied with your total physical memory. Why your application get this type of error cannot be specifically answered without an investigation. However the possible caused can be
Not handling graceful closure
too many open sockets
some app or driver taking too many NP memory
Faulty driver not releasing NP memory etc

What you can do is
send data in smaller packet ( less than 4K IMHO but the docs say less than 64K )
Set the send buffer to 0 ( SO_SNDBUF ), so the stack will take directly from the application buffer.
Ensure that the you are handling gracefull socket closure

Changing the value of SO_SNDBUF won't have an effect in your case. See if this happens in other system with the same configuration.