/** * Send a message to the client * * @return true if message is not empty */ public boolean sendMessage() { if (messageToSend.length() == 0) return false; client.sendMessage(messageToSend.toString()); addMessageToLog("You: " + messageToSend.toString()); messageToSend.delete(0, messageToSend.length()); return true; }
/** Disconnect from the server */ public void disconnect() { client.sendMessage("Disconnected"); client = null; }