aboutsummaryrefslogtreecommitdiff
path: root/juick-server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-03-28 07:36:31 +0000
committerGravatar Vitaly Takmazov2018-03-28 07:36:31 +0000
commitc1fa5111b1a24048c7c747787d158a725aa5c9b2 (patch)
treed234c70ea254bfe99d162c67a298460867b31139 /juick-server
parenta45dc39ce534941b9ca041f8fddf10d299b085ef (diff)
server: correctly close xmpp server socket
Diffstat (limited to 'juick-server')
-rw-r--r--juick-server/src/main/java/com/juick/server/XMPPServer.java5
1 files changed, 1 insertions, 4 deletions
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");
}