com.threerings.presents.net
Class UpstreamMessage

java.lang.Object
  extended by com.threerings.io.SimpleStreamableObject
      extended by com.threerings.presents.net.Message
          extended by com.threerings.presents.net.UpstreamMessage
All Implemented Interfaces:
Streamable
Direct Known Subclasses:
AuthRequest, BlockingCommunicator.TerminationMessage, CompoundUpstreamMessage, ForwardEventRequest, LogoffRequest, PingRequest, SubscribeRequest, ThrottleUpdatedMessage, TransmitDatagramsRequest, UnsubscribeRequest

public abstract class UpstreamMessage
extends Message

This class encapsulates a message in the distributed object protocol that flows from the client to the server. Upstream messages include object subscription, event forwarding and session management.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
Streamable.Closure
 
Field Summary
protected static short _nextMessageId
          This is used to generate monotonically increasing message ids on the client as new messages are generated.
 short messageId
          This is a unique (within the context of a reasonable period of time) identifier assigned to each upstream message.
 
Fields inherited from class com.threerings.presents.net.Message
received
 
Constructor Summary
UpstreamMessage()
          Each upstream message derived class must provide a zero argument constructor so that it can be unserialized when read from the network.
 
Method Summary
protected static short nextMessageId()
          Returns the next message id suitable for use by an upstream message.
 String toString()
           
 
Methods inherited from class com.threerings.presents.net.Message
getTransport, noteActualTransport, setTransport
 
Methods inherited from class com.threerings.io.SimpleStreamableObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

messageId

public short messageId
This is a unique (within the context of a reasonable period of time) identifier assigned to each upstream message. The message ids are used to correlate a downstream response message to the appropriate upstream request message.


_nextMessageId

protected static short _nextMessageId
This is used to generate monotonically increasing message ids on the client as new messages are generated.

Constructor Detail

UpstreamMessage

public UpstreamMessage()
Each upstream message derived class must provide a zero argument constructor so that it can be unserialized when read from the network.

Method Detail

toString

public String toString()
Overrides:
toString in class SimpleStreamableObject

nextMessageId

protected static short nextMessageId()
Returns the next message id suitable for use by an upstream message.