Пример #1
0
 /**
  * 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;
 }
Пример #2
0
 /** Disconnect from the server */
 public void disconnect() {
   client.sendMessage("Disconnected");
   client = null;
 }