From c1fa5111b1a24048c7c747787d158a725aa5c9b2 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 28 Mar 2018 07:36:31 +0000 Subject: server: correctly close xmpp server socket --- juick-server/src/main/java/com/juick/server/XMPPServer.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'juick-server') diff --git a/juick-server/src/main/java/com/juick/server/XMPPServer.java b/juick-server/src/main/java/com/juick/server/XMPPServer.java index 53ad61a6..c651a16c 100644 --- a/juick-server/src/main/java/com/juick/server/XMPPServer.java +++ b/juick-server/src/main/java/com/juick/server/XMPPServer.java @@ -145,7 +145,7 @@ public class XMPPServer implements ConnectionListener, AutoCloseable { @Override public void close() throws Exception { - if (!listener.isClosed()) { + if (listener != null && !listener.isClosed()) { listener.close(); } outConnections.forEach((c, s) -> { @@ -156,9 +156,6 @@ public class XMPPServer implements ConnectionListener, AutoCloseable { c.closeConnection(); inConnections.remove(c); }); - if (!listener.isClosed()) { - listener.close(); - } service.shutdown(); logger.info("XMPP server destroyed"); } -- cgit v1.2.3