com.threerings.presents.net
Class PingRequest

java.lang.Object
  extended by com.threerings.io.SimpleStreamableObject
      extended by com.threerings.presents.net.Message
          extended by com.threerings.presents.net.UpstreamMessage
              extended by com.threerings.presents.net.PingRequest
All Implemented Interfaces:
Streamable

public class PingRequest
extends UpstreamMessage

Let's the server know we're still alive.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
Streamable.Closure
 
Field Summary
protected  long _packStamp
          A time stamp obtained when we serialize this object.
protected  Transport _transport
          The transport parameters.
protected  long _unpackStamp
          A time stamp obtained when we unserialize this object (the intent is to get a timestamp as close as possible to when the packet was received on the network).
static long PING_INTERVAL
          The number of milliseconds of idle upstream that are allowed to elapse before the client sends a ping message to the server to let it know that we're still alive.
 
Fields inherited from class com.threerings.presents.net.UpstreamMessage
_nextMessageId, messageId
 
Fields inherited from class com.threerings.presents.net.Message
received
 
Constructor Summary
PingRequest()
          Zero argument constructor used when unserializing an instance.
PingRequest(Transport transport)
          Creates a new ping request using the specified transport.
 
Method Summary
 long getPackStamp()
          Returns a timestamp that was obtained when this packet was encoded by the low-level networking code.
 Transport getTransport()
          Returns the message transport parameters.
 long getUnpackStamp()
          Returns a timestamp that was obtained when this packet was decoded by the low-level networking code.
 void readObject(ObjectInputStream in)
          Reads our custom streamable fields.
 void setTransport(Transport transport)
          Sets the message transport parameters.
 String toString()
           
 void writeObject(ObjectOutputStream out)
          Writes our custom streamable fields.
 
Methods inherited from class com.threerings.presents.net.UpstreamMessage
nextMessageId
 
Methods inherited from class com.threerings.presents.net.Message
noteActualTransport
 
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

PING_INTERVAL

public static final long PING_INTERVAL
The number of milliseconds of idle upstream that are allowed to elapse before the client sends a ping message to the server to let it know that we're still alive.

See Also:
Constant Field Values

_packStamp

protected transient long _packStamp
A time stamp obtained when we serialize this object.


_unpackStamp

protected transient long _unpackStamp
A time stamp obtained when we unserialize this object (the intent is to get a timestamp as close as possible to when the packet was received on the network).


_transport

protected transient Transport _transport
The transport parameters.

Constructor Detail

PingRequest

public PingRequest()
Zero argument constructor used when unserializing an instance.


PingRequest

public PingRequest(Transport transport)
Creates a new ping request using the specified transport.

Method Detail

getPackStamp

public long getPackStamp()
Returns a timestamp that was obtained when this packet was encoded by the low-level networking code.


getUnpackStamp

public long getUnpackStamp()
Returns a timestamp that was obtained when this packet was decoded by the low-level networking code.


writeObject

public void writeObject(ObjectOutputStream out)
                 throws IOException
Writes our custom streamable fields.

Throws:
IOException

readObject

public void readObject(ObjectInputStream in)
                throws IOException,
                       ClassNotFoundException
Reads our custom streamable fields.

Throws:
IOException
ClassNotFoundException

setTransport

public void setTransport(Transport transport)
Description copied from class: Message
Sets the message transport parameters. For messages received over the network, these describe the mode of transport over which the message was received. When sending messages, they act as a hint as to the type of transport desired. Calling this method may have no effect, depending on whether non-default modes of transport are supported for this message type.

Overrides:
setTransport in class Message

getTransport

public Transport getTransport()
Description copied from class: Message
Returns the message transport parameters.

Overrides:
getTransport in class Message

toString

public String toString()
Overrides:
toString in class UpstreamMessage