Commit 3f40bf10 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Close s2s and external component sessions when shutting down the server and...

Close s2s and external component sessions when shutting down the server and then clean up server name. JM-548

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3366 b35dd754-fafc-0310-a699-88a17e54d16e
parent ec7f231e
......@@ -1461,12 +1461,20 @@ public class SessionManager extends BasicModule {
// Stop threads that are sending packets to remote servers
OutgoingSessionPromise.getInstance().shutdown();
timer.cancel();
serverName = null;
if (JiveGlobals.getBooleanProperty("shutdownMessage.enabled")) {
sendServerMessage(null, LocaleUtils.getLocalizedString("admin.shutdown.now"));
}
try {
for (Session session : getSessions()) {
// Send the close stream header to all connected connections
Set<Session> sessions = new HashSet<Session>();
sessions.addAll(getSessions());
sessions.addAll(getComponentSessions());
sessions.addAll(outgoingServerSessions.values());
for (List<IncomingServerSession> incomingSessions : incomingServerSessions.values()) {
sessions.addAll(incomingSessions);
}
for (Session session : sessions) {
try {
session.getConnection().close();
}
......@@ -1478,6 +1486,7 @@ public class SessionManager extends BasicModule {
catch (Exception e) {
// Ignore.
}
serverName = null;
}
/******************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment