Between the time that we're shutdown and the time that we finally exit, do not
accept new connections or read incoming messages from any of our extant connections. Do send outgoing messages to those connections, but nothing else. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5493 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -255,7 +255,7 @@ public class ConnectionManager extends LoopingThread
|
||||
report.append(avgOut).append(" avg size, ");
|
||||
report.append(bytesOut*1000/sinceLast).append(" bps\n");
|
||||
}
|
||||
|
||||
|
||||
@Override // from LoopingThread
|
||||
public boolean isRunning ()
|
||||
{
|
||||
@@ -446,6 +446,15 @@ public class ConnectionManager extends LoopingThread
|
||||
// send any messages that are waiting on the outgoing overflow and message queues
|
||||
sendOutgoingMessages(iterStamp);
|
||||
|
||||
// if we have been shutdown, but we're stick around because the DObjectManager is still
|
||||
// running (and we want to deliver any outgoing events queued up during shutdown), then we
|
||||
// stop here, because we've delivered outgoing events on this tick and all that remains
|
||||
// below is accepting new connections and receiving incoming messages, neither of which we
|
||||
// want to do during the shutdown process
|
||||
if (!super.isRunning()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// check for connections that have completed authentication
|
||||
AuthingConnection conn;
|
||||
while ((conn = _authq.getNonBlocking()) != null) {
|
||||
@@ -859,7 +868,7 @@ public class ConnectionManager extends LoopingThread
|
||||
if (!isRunning()) {
|
||||
log.warning("Posting message to inactive connection manager", new Exception());
|
||||
}
|
||||
|
||||
|
||||
// sanity check
|
||||
if (conn == null || msg == null) {
|
||||
log.warning("postMessage() bogosity", "conn", conn, "msg", msg, new Exception());
|
||||
|
||||
Reference in New Issue
Block a user