From 2c0ca575518de9eadb52891a9bd93d1683306354 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 11 Nov 2008 01:04:08 +0000 Subject: [PATCH] Nix startup listener since that was only being used to shut everything down if we fail to bind to any of our desired ports. We'll just do that automatically because no one wants a totally hapless server sitting around unable to actually accept any connections. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5536 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../server/net/ConnectionManager.java | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/src/java/com/threerings/presents/server/net/ConnectionManager.java b/src/java/com/threerings/presents/server/net/ConnectionManager.java index b456a6cea..c65944c9c 100644 --- a/src/java/com/threerings/presents/server/net/ConnectionManager.java +++ b/src/java/com/threerings/presents/server/net/ConnectionManager.java @@ -122,17 +122,6 @@ public class ConnectionManager extends LoopingThread _lastStats = new ConMgrStats(); } - /** - * Configures the connection manager with an entity that will be informed of the success or - * failure of the connection manager initialization process. Note: the callback - * methods will be called on the connection manager thread, so be careful not to do anything on - * those methods that will conflict with activities on the dobjmgr thread, etc. - */ - public void setStartupListener (ResultListener rl) - { - _startlist = rl; - } - /** * Adds an authenticator to the authentication chain. This authenticator will be offered a * chance to authenticate incoming connections in lieu of the main autuenticator. @@ -437,9 +426,8 @@ public class ConnectionManager extends LoopingThread // if we failed to listen on at least one port, give up the ghost if (successes == 0) { - if (_startlist != null) { - _startlist.requestFailed(failure); - } + log.warning("ConnectionManager failed to bind to any ports. Shutting down."); + _shutmgr.queueShutdown(); return; } @@ -460,11 +448,6 @@ public class ConnectionManager extends LoopingThread port + "'.", ioe); } } - - // notify our startup listener, if we have one - if (_startlist != null) { - _startlist.requestCompleted(null); - } } /** Helper function for {@link #willStart}. */ @@ -1230,7 +1213,6 @@ public class ConnectionManager extends LoopingThread protected Selector _selector; protected ServerSocketChannel _ssocket; protected DatagramChannel _datagramChannel; - protected ResultListener _startlist; /** Counts consecutive runtime errors in select(). */ protected int _runtimeExceptionCount; @@ -1268,11 +1250,10 @@ public class ConnectionManager extends LoopingThread /** A runnable to execute when the connection manager thread exits. */ protected volatile Runnable _onExit; - /** The invoker on which we do our authenticating. */ + // some dependencies @Inject @AuthInvoker protected Invoker _authInvoker; - - /** The distributed object manager with which we operate. */ @Inject protected PresentsDObjectMgr _omgr; + @Inject protected ShutdownManager _shutmgr; /** How long we wait for network events before checking our running flag to see if we should * still be running. We don't want to loop too tightly, but we need to make sure we don't sit