Changes in client: moved the 'disconnect' error from the send method to the receive method. This makes the error message show up as soon as the connection is broken.