Recv
From PortaWiki
- Under some timing conditions recv() under Windows can return '0 = no data read' rather than '0 = remote system has closed the connection'. This requires a delay of maybe 10-50ms after the last network I/O before calling recv(). If the recv() is preceded by a select then select will indicate that data is available but recv() will return 0. WSAGetLastError() returns no error, and any other attempts to try and differentiate 0 (case 1) from 0 (case 2) have proven unsuccessful. This problems has been found on all platforms from Win98 to (at least) WinXP.