Example #1
0
 /** to handle only the dosconnection of the user */
 public synchronized void disconnectUser() throws Exception {
   HandleUser.deleteUser(getNickName());
   listeningThread.disconnect();
   talkingThread.disconnect();
   talkingThread.notifyTalking();
   socket.close();
 }
Example #2
0
  /** to start the listening and the talking thread */
  public void startProcess() throws IOException {
    if (listeningThread == null) {
      listeningThread = new Listening(socket.getInputStream(), this);
      listeningThread.start();
    }

    if (talkingThread == null) {
      talkingThread = new Talking(socket.getOutputStream(), this);
      talkingThread.start();
    }
  }
Example #3
0
 /**
  * to add responses to the list of responses to send back to the client
  *
  * @param messages the messages to add
  */
 public synchronized void addResponses(Message[] messages) {
   talkingThread.addResponses(messages);
 }