Passing in the timestamp that dictates idleness allows us to propagate the idle
duration a bit less far. And Ray will be pleased to know that we're doing much less redundant arithmetic. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6385 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -171,8 +171,9 @@ public abstract class ConnectionManager extends LoopingThread
|
||||
}
|
||||
|
||||
// close connections that have had no network traffic for too long
|
||||
long idleStamp = iterStamp - _idleTime;
|
||||
for (NetEventHandler handler : _handlers.values()) {
|
||||
if (handler.checkIdle(iterStamp)) {
|
||||
if (handler.checkIdle(idleStamp)) {
|
||||
// this will queue the connection for closure on our next tick
|
||||
handler.becameIdle();
|
||||
}
|
||||
@@ -217,7 +218,7 @@ public abstract class ConnectionManager extends LoopingThread
|
||||
// create a new authing connection object to manage the authentication of this client
|
||||
// connection and register it with our selection set
|
||||
channel.configureBlocking(false);
|
||||
conn.init(this, channel, System.currentTimeMillis(), _idleTime);
|
||||
conn.init(this, channel, System.currentTimeMillis());
|
||||
conn.selkey = register(channel, SelectionKey.OP_READ, conn);
|
||||
_handlers.put(conn.selkey, conn);
|
||||
synchronized (this) {
|
||||
|
||||
Reference in New Issue
Block a user