/** * Closes the client. If the connection is already closed, this call has no effect. * * @exception IOException if an error occurs when closing the socket. */ public final void close() throws IOException { readyToStop = true; // Set the flag that tells the thread to stop try { closeAll(); } finally { server.clientDisconnected(this); } }