|
@ -39,6 +39,20 @@ public class ClientHandler implements Runnable { |
|
|
} |
|
|
} |
|
|
} catch (IOException e) { |
|
|
} catch (IOException e) { |
|
|
e.printStackTrace(); |
|
|
e.printStackTrace(); |
|
|
|
|
|
} finally { |
|
|
|
|
|
//chatServer.removeClient(this); |
|
|
|
|
|
chatServer.broadcastMessage(name + " disconnected."); |
|
|
|
|
|
|
|
|
|
|
|
if (fromClientReader != null) { |
|
|
|
|
|
try { |
|
|
|
|
|
fromClientReader.close(); |
|
|
|
|
|
} catch (IOException e){ |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (toClientWriter != null) { |
|
|
|
|
|
toClientWriter.close(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|