Re: WSAENOBUFS on winsock client application



I'd guess that it's more likely to be a bug in the way the code
handle's the unexpected connection termination which possibly results
in some corruption somewhere. Or just broken error handling?

Yes, that might be possible, of course. The way handling an unexpected
connection closure (caused by the server or network) is as follows :

1. receiving error on pending I/O-Operation (WSARecv or WSASend) or
receiving an FD_CLOSE event.
2. call WSASendDisconnect(...)
3. wait for termination of pending I/O operation, if any.
4. activate the DONTLINGER Option using setsockopt
5. call closesocket

any idea what might be wrong ?

--
best regards
friedhelm


"Len Holgate" wrote:

It doesnt really make sense that it's just ONE connection having this
problem though, does it? Surely if Winsock was experiencing a low
resource situation you'd get WSAENOBUFS occurring on lots of
operations on various open sockets, rather than just on the one?

I've seen this a lot under real low resource situations, see here for
more details:
http://www.lenholgate.com/archives/000580.html
http://www.lenholgate.com/archives/000564.html
and things that these blog posts link to...

I'd guess that it's more likely to be a bug in the way the code
handle's the unexpected connection termination which possibly results
in some corruption somewhere. Or just broken error handling?

As an aside, I thought that WSAENOBUFS was related to non-paged pool
or locked pages limits than simple memory allocation?

Len Holgate
http://www.lenholgate.com
Free C++ IOCP server framework available here: http://www.lenholgate.com/archives/000637.html




.