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