receives a message from a socket.
It overcomes the message fragmentation problem and always waits for all
requested bytes to arrive or a timeout/error occurs.
This routine returns the number of bytes if the operation was successful,
0 if the connection was closed by the remote end
or -1 if the operation failed. In the latter case,
is set appropriately.
The function was interrupted by a signal.
is not a valid descriptor.
The socket is non-blocking and there is no message available.