Add error handling to reading new data from the socket.
Send verification of close when client requests the connection be closed.