|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.presents.server.PresentsSession
com.threerings.presents.peer.server.PeerSession
public class PeerSession
Manages a peer session.
| Nested Class Summary |
|---|
| Field Summary | |
|---|---|
protected int |
_cloid
|
protected long |
_nextThrottleWarning
|
protected PeerManager |
_peermgr
|
protected PeerManager.Stats |
_stats
|
| Fields inherited from class com.threerings.presents.server.PresentsSession |
|---|
_areq, _authdata, _authname, _clmgr, _clobj, _compound, _compoundDepth, _conmgr, _conn, _connectTime, _destroyedSubs, _disps, _invmgr, _loader, _messagesDropped, _messagesIn, _messagesOut, _messagesPerSec, _networkStamp, _omgr, _pendingThrottles, _sessionStamp, _subscrips, _throttle, DEFAULT_FLUSH_TIME, PING_DEBUG |
| Constructor Summary | |
|---|---|
PeerSession(PeerManager peermgr)
Creates a peer session and provides it with a reference to the peer manager. |
|
| Method Summary | |
|---|---|
protected BootstrapData |
createBootstrapData()
Derived client classes can override this member to create derived bootstrap data classes that contain extra bootstrap information, if desired. |
protected Throttle |
createIncomingMessageThrottle()
Creates our incoming message throttle. |
void |
handleMessage(Message message)
Called when a complete message has been parsed from incoming network data. |
protected void |
handleThrottleExceeded()
Called when a client exceeds their allotted incoming messages per second throttle. |
protected void |
populateBootstrapData(BootstrapData data)
Derived client classes can override this member to populate the bootstrap data with additional information. |
protected boolean |
postMessage(DownstreamMessage msg,
PresentsConnection expect)
Queues a message for delivery to the client. |
protected void |
sessionConnectionClosed()
Called on the dobjmgr thread when the connection associated with this session has been closed and unmapped. |
protected void |
sessionDidEnd()
Called when the client session ends (either because the client logged off or because the server forcibly terminated the session). |
protected void |
sessionWillStart()
Called when the client session is first started. |
void |
setStats(PeerManager.Stats stats)
Passes in a stats instance that this peer can use to note when it trafficks. |
protected void |
subscribedToObject(DObject object)
Called to inform derived classes when the client has subscribed to a distributed object. |
protected void |
unsubscribedFromObject(DObject object)
Called to inform derived classes when the client has unsubscribed from a distributed object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected PeerManager _peermgr
protected PeerManager.Stats _stats
protected int _cloid
protected long _nextThrottleWarning
| Constructor Detail |
|---|
@Inject public PeerSession(PeerManager peermgr)
| Method Detail |
|---|
public void setStats(PeerManager.Stats stats)
public void handleMessage(Message message)
PresentsConnection.MessageHandler
handleMessage in interface PresentsConnection.MessageHandlerhandleMessage in class PresentsSessionprotected BootstrapData createBootstrapData()
PresentsSession
createBootstrapData in class PresentsSessionprotected void populateBootstrapData(BootstrapData data)
PresentsSessionsuper.populateBootstrapData
before doing their own populating, however.
Note: This function will be called on the dobjmgr thread which means that object manipulations are OK, but client instance manipulations must be done carefully.
populateBootstrapData in class PresentsSessionprotected void sessionWillStart()
PresentsSessionsuper.sessionWillStart.
Note: This function will be called on the dobjmgr thread which means that object manipulations are OK, but client instance manipulations must done carefully.
sessionWillStart in class PresentsSessionprotected void sessionConnectionClosed()
PresentsSessionPresentsSession.sessionDidEnd().
sessionConnectionClosed in class PresentsSessionprotected void sessionDidEnd()
PresentsSessionsuper.sessionDidEnd.
Note: This function will be called on the dobjmgr thread which means that object manipulations are OK, but client instance manipulations must done carefully.
sessionDidEnd in class PresentsSession
protected final boolean postMessage(DownstreamMessage msg,
PresentsConnection expect)
PresentsSession
postMessage in class PresentsSessionprotected void subscribedToObject(DObject object)
PresentsSession
subscribedToObject in class PresentsSessionprotected void unsubscribedFromObject(DObject object)
PresentsSession
unsubscribedFromObject in class PresentsSessionprotected Throttle createIncomingMessageThrottle()
PresentsSessionPresentsSession.setIncomingMessageThrottle(int) to adjust the
throttle for running clients.
createIncomingMessageThrottle in class PresentsSessionprotected void handleThrottleExceeded()
PresentsSession
handleThrottleExceeded in class PresentsSession
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||