diff --git a/server/src/main/java/nl/andrewlalis/aos_server/ClientHandler.java b/server/src/main/java/nl/andrewlalis/aos_server/ClientHandler.java index 4a3f527..42bee1d 100644 --- a/server/src/main/java/nl/andrewlalis/aos_server/ClientHandler.java +++ b/server/src/main/java/nl/andrewlalis/aos_server/ClientHandler.java @@ -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; diff --git a/server/src/main/java/nl/andrewlalis/aos_server/Server.java b/server/src/main/java/nl/andrewlalis/aos_server/Server.java index 5afd364..6ef0ee3 100644 --- a/server/src/main/java/nl/andrewlalis/aos_server/Server.java +++ b/server/src/main/java/nl/andrewlalis/aos_server/Server.java @@ -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) {