I'm wondering why closing a socket with the standard close function without a prior call to the shutdown function after failing to sending data due to an unavailable peer doesn't cause a recv function on the same socket to return ?
pseudo code:
void sendData()
{
::send(socket_,...);
if(error)
close(socket_); //recv still block after this call
}
void worker()
{
while(1)
{
::recv(socket_...)
if(error)
break;
}
}