I am familiar with scenarios where the connection is interrupted without the socket being notified, leaving it in a state as you describe.
In your case, you should be able to change the socket into non-blocking mode by calling
ioctlsocket()
then close it upon exiting the
recv()
call.
int iResult;
u_long iMode = 0;
iResult = ioctlsocket(m_socket, FIONBIO, &iMode);
Soren Madsen