Make ConnectionManager a general-purpose select server and implement a flash Policy server with it.
The presents-specific portions of ConnectionManager like reading Message subclasses and sending datagrams are now in PresentsConnectionManager. PresentsServer should behave identically, except during shutdown. Before, connections would be accepted and datagrams would be read until the OMgr thread exited. Now, both stop as soon as the server begins its shutdown. This seems like an improvement to me, but let me know if it causes issues and I can rework it. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6270 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -57,6 +57,10 @@ import com.threerings.io.Streamable;
|
||||
|
||||
import com.threerings.util.Name;
|
||||
|
||||
import com.threerings.presents.annotation.MainInvoker;
|
||||
import com.threerings.presents.client.Client;
|
||||
import com.threerings.presents.client.InvocationService;
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
import com.threerings.presents.dobj.EntryAddedEvent;
|
||||
import com.threerings.presents.dobj.EntryRemovedEvent;
|
||||
@@ -64,11 +68,13 @@ import com.threerings.presents.dobj.EntryUpdatedEvent;
|
||||
import com.threerings.presents.dobj.ObjectAccessException;
|
||||
import com.threerings.presents.dobj.SetListener;
|
||||
import com.threerings.presents.dobj.Subscriber;
|
||||
|
||||
import com.threerings.presents.annotation.MainInvoker;
|
||||
import com.threerings.presents.client.Client;
|
||||
import com.threerings.presents.client.InvocationService;
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
import com.threerings.presents.peer.client.PeerService;
|
||||
import com.threerings.presents.peer.data.ClientInfo;
|
||||
import com.threerings.presents.peer.data.NodeObject;
|
||||
import com.threerings.presents.peer.data.PeerAuthName;
|
||||
import com.threerings.presents.peer.net.PeerCreds;
|
||||
import com.threerings.presents.peer.server.persist.NodeRecord;
|
||||
import com.threerings.presents.peer.server.persist.NodeRepository;
|
||||
import com.threerings.presents.server.ClientManager;
|
||||
import com.threerings.presents.server.InvocationException;
|
||||
import com.threerings.presents.server.InvocationManager;
|
||||
@@ -77,15 +83,7 @@ import com.threerings.presents.server.PresentsSession;
|
||||
import com.threerings.presents.server.ReportManager;
|
||||
import com.threerings.presents.server.ServiceAuthenticator;
|
||||
import com.threerings.presents.server.SessionFactory;
|
||||
import com.threerings.presents.server.net.ConnectionManager;
|
||||
|
||||
import com.threerings.presents.peer.client.PeerService;
|
||||
import com.threerings.presents.peer.data.ClientInfo;
|
||||
import com.threerings.presents.peer.data.NodeObject;
|
||||
import com.threerings.presents.peer.data.PeerAuthName;
|
||||
import com.threerings.presents.peer.net.PeerCreds;
|
||||
import com.threerings.presents.peer.server.persist.NodeRecord;
|
||||
import com.threerings.presents.peer.server.persist.NodeRepository;
|
||||
import com.threerings.presents.server.net.PresentsConnectionManager;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
@@ -1599,7 +1597,7 @@ public abstract class PeerManager
|
||||
// our service dependencies
|
||||
@Inject protected @MainInvoker Invoker _invoker;
|
||||
@Inject protected ClientManager _clmgr;
|
||||
@Inject protected ConnectionManager _conmgr;
|
||||
@Inject protected PresentsConnectionManager _conmgr;
|
||||
@Inject protected Injector _injector;
|
||||
@Inject protected InvocationManager _invmgr;
|
||||
@Inject protected NodeRepository _noderepo;
|
||||
|
||||
@@ -48,7 +48,7 @@ import com.threerings.presents.peer.data.NodeObject;
|
||||
import com.threerings.presents.peer.net.PeerBootstrapData;
|
||||
import com.threerings.presents.peer.server.persist.NodeRecord;
|
||||
import com.threerings.presents.server.PresentsDObjectMgr;
|
||||
import com.threerings.presents.server.net.ConnectionManager;
|
||||
import com.threerings.presents.server.net.PresentsConnectionManager;
|
||||
import com.threerings.presents.server.net.ServerCommunicator;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
@@ -354,7 +354,7 @@ public class PeerNode
|
||||
|
||||
@Inject protected PeerManager _peermgr;
|
||||
@Inject protected PresentsDObjectMgr _omgr;
|
||||
@Inject protected ConnectionManager _conmgr;
|
||||
@Inject protected PresentsConnectionManager _conmgr;
|
||||
|
||||
/** The amount of time after which a node record can be considered out of date and invalid. */
|
||||
protected static final long STALE_INTERVAL = 5L * 60L * 1000L;
|
||||
|
||||
Reference in New Issue
Block a user