diff --git a/Client/src/main/java/com/baseband/client/event/remote/RemoteEventManager.java b/Client/src/main/java/com/baseband/client/event/remote/RemoteEventManager.java index 1d1f28e..7083f89 100644 --- a/Client/src/main/java/com/baseband/client/event/remote/RemoteEventManager.java +++ b/Client/src/main/java/com/baseband/client/event/remote/RemoteEventManager.java @@ -51,6 +51,18 @@ public class RemoteEventManager { } public void end() { + ServerSocket server = this.server; + Socket head = this.head; + clients.clear(); + id = -1; + peers = 0; + this.server = null; + this.head = null; + try { + Thread.sleep(50); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } try { if(server != null) { server.close(); @@ -59,11 +71,6 @@ public class RemoteEventManager { head.close(); } } catch (IOException ignored) {} - clients.clear(); - id = -1; - peers = 0; - server = null; - head = null; BaseBand.ifFeatureEnabled(AltControl.class, f -> f.setEnabled(false)); }