Cleaned up client disconnect scenario.
This commit is contained in:
parent
4e01673bf8
commit
ee6d7a00cb
|
@ -88,9 +88,6 @@ public class ClientHandler extends Thread {
|
|||
|
||||
public void shutdown() {
|
||||
this.running = false;
|
||||
if (!this.socket.isClosed()) {
|
||||
this.send(new Message(Type.SERVER_SHUTDOWN));
|
||||
}
|
||||
this.sendingQueue.shutdown();
|
||||
try {
|
||||
boolean terminated = false;
|
||||
|
|
|
@ -185,6 +185,7 @@ public class Server {
|
|||
try {
|
||||
this.serverSocket.close();
|
||||
for (ClientHandler handler : this.clientHandlers) {
|
||||
handler.send(new Message(Type.SERVER_SHUTDOWN));
|
||||
handler.shutdown();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
|
Loading…
Reference in New Issue