Re: recv() hang



Do you specify SO_LINGER options? Do you open the socket as OVERLAPPED? Do
you call shutdown before closesocket?

the typical sequence is to detect a broken connection thru failed send /
WSASend and then call shutdown(SD_BOTH) and, when the last IOP has failed,
call closesocket. This prevents failures causes by potential handle reuse,
but IIRC only works correctly for OVERLAPPED sockets.

"naveen gupta" <gupta.naveen16@xxxxxxxxx> wrote in message
news:a88a3811-3ff5-44f5-a3cf-b887a47f17bb@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i m sending data very frequently at remote host, when transport n/w
down then i terminate the connection and dont deliver data to remote
host, but recv() func(at receiver side) did not return any error when
transport n/w down and waits for data.


.



Relevant Pages