public void run() {
   try {
     this.tcpCommunication = new TCPCommunication(clientSocket);
   } catch (IOException e) {
     exit();
     return;
   }
   while (!interrupted() && clientSocket != null) {
     try {
       String receivedMessage = tcpCommunication.receive();
       if (receivedMessage == null) {
         exit();
         break;
       }
       server.receiveMessage(receivedMessage, clientSocket);
     } catch (IOException e) {
       exit();
     }
   }
   // TODO perhaps send disconnect event from here
 }
예제 #2
0
 @Override
 public void process(Player player, Server server) {
   server.receiveMessage(player, this);
 }