com.threerings.presents.server.net
Class ServerCommunicator

java.lang.Object
  extended by com.threerings.presents.client.Communicator
      extended by com.threerings.presents.server.net.ServerCommunicator

public class ServerCommunicator
extends Communicator

Provides Client Communicator services using non-blocking I/O and the connection manager.


Field Summary
protected  PresentsConnectionManager _conmgr
           
protected  PresentsConnection _conn
           
protected  ClassLoader _loader
           
protected  Exception _logonError
           
protected  RootDObjectManager _rootmgr
           
protected static boolean PING_DEBUG
           
 
Fields inherited from class com.threerings.presents.client.Communicator
_client, _lastWrite, _omgr
 
Constructor Summary
ServerCommunicator(Client client, PresentsConnectionManager conmgr, RootDObjectManager rootmgr)
           
 
Method Summary
 void gotBootstrap()
          Notifies the communicator that the client has received its bootstrap data.
 void logoff()
          Delivers a logoff notification to the server and shuts down the network connection.
 void logon()
          Logs on to the server and initiates our full-duplex message exchange.
protected  void logonSucceeded(AuthResponseData data)
          Called when the authentication process completes successfully.
 void postMessage(UpstreamMessage msg)
          Queues up the specified message for delivery upstream.
 void setClassLoader(ClassLoader loader)
          Configures this communicator with a custom class loader to be used when reading and writing objects over the network.
protected  void shutdown()
           
 
Methods inherited from class com.threerings.presents.client.Communicator
clientCleanup, getLastWrite, getTransmitDatagrams, gotAuthResponse, notifyClientObservers, processMessage, updateWriteStamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_conmgr

protected PresentsConnectionManager _conmgr

_rootmgr

protected RootDObjectManager _rootmgr

_conn

protected PresentsConnection _conn

_loader

protected ClassLoader _loader

_logonError

protected Exception _logonError

PING_DEBUG

protected static final boolean PING_DEBUG
Constructor Detail

ServerCommunicator

public ServerCommunicator(Client client,
                          PresentsConnectionManager conmgr,
                          RootDObjectManager rootmgr)
Method Detail

logon

public void logon()
Description copied from class: Communicator
Logs on to the server and initiates our full-duplex message exchange.

Specified by:
logon in class Communicator

logoff

public void logoff()
Description copied from class: Communicator
Delivers a logoff notification to the server and shuts down the network connection. Also causes all communication threads to terminate.

Specified by:
logoff in class Communicator

gotBootstrap

public void gotBootstrap()
Description copied from class: Communicator
Notifies the communicator that the client has received its bootstrap data.

Specified by:
gotBootstrap in class Communicator

postMessage

public void postMessage(UpstreamMessage msg)
Description copied from class: Communicator
Queues up the specified message for delivery upstream.

Specified by:
postMessage in class Communicator

setClassLoader

public void setClassLoader(ClassLoader loader)
Description copied from class: Communicator
Configures this communicator with a custom class loader to be used when reading and writing objects over the network.

Specified by:
setClassLoader in class Communicator

logonSucceeded

protected void logonSucceeded(AuthResponseData data)
Description copied from class: Communicator
Called when the authentication process completes successfully. Derived classes can override this method and complete any initialization that need wait for authentication success.

Overrides:
logonSucceeded in class Communicator

shutdown

protected void shutdown()