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 get the idle's time of the user */
 public long getIdle() {
   return listeningThread.getIdle();
 }