There are NetEventHandlers that want to directly modify _handlers; let's let them.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6757 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Par Winzell
2012-01-03 14:54:22 +00:00
parent 876e5ecaaa
commit db78d695a6
@@ -32,6 +32,7 @@ import java.nio.channels.SelectionKey;
import java.nio.channels.Selector; import java.nio.channels.Selector;
import java.nio.channels.SocketChannel; import java.nio.channels.SocketChannel;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.google.inject.name.Named; import com.google.inject.name.Named;
@@ -171,7 +172,7 @@ public abstract class ConnectionManager extends LoopingThread
// close connections that have had no network traffic for too long // close connections that have had no network traffic for too long
long idleStamp = iterStamp - _idleTime; long idleStamp = iterStamp - _idleTime;
for (NetEventHandler handler : _handlers.values()) { for (NetEventHandler handler : Lists.newArrayList(_handlers.values())) {
if (handler.checkIdle(idleStamp)) { if (handler.checkIdle(idleStamp)) {
// this will queue the connection for closure on our next tick // this will queue the connection for closure on our next tick
handler.becameIdle(); handler.becameIdle();