info.jedi.net
Class InputPacket

java.lang.Object
  |
  +--info.jedi.net.InputPacket

public class InputPacket
extends java.lang.Object
implements Packet

Associates a packet that has been received by JEDI with a DataInputStream for reading the contents of the packet.

See Also:
PacketHandler, MailDaemon, Packet

Constructor Summary
InputPacket(java.net.DatagramPacket packet)
          Initializes data members and creates a DataInputStream to read the contents of this packet
 
Method Summary
 java.net.InetAddress address()
          The internet address this packet came from
 int id()
          The id of this packet
 int port()
          The port this packet came from
 void setID(int id)
          sets the id of this packet.
 void setTime(long time)
          sets the timestamp.
 void setTimeout(int newTimeout)
          sets the timeout.
 java.io.DataInputStream stream()
          The stream for reading the contents of this packet
 long time()
          The sending timestamp of this packet
 int timeout()
          The timeout this packet was sent with
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputPacket

public InputPacket(java.net.DatagramPacket packet)
Initializes data members and creates a DataInputStream to read the contents of this packet
Method Detail

address

public java.net.InetAddress address()
The internet address this packet came from
Specified by:
address in interface Packet

port

public int port()
The port this packet came from
Specified by:
port in interface Packet

id

public int id()
The id of this packet
Specified by:
id in interface Packet

time

public long time()
The sending timestamp of this packet
Specified by:
time in interface Packet

timeout

public int timeout()
The timeout this packet was sent with
Specified by:
timeout in interface Packet

setID

public void setID(int id)
sets the id of this packet. After this call, id() will return a valid id number

setTime

public void setTime(long time)
sets the timestamp. time() returns a valid timestamp after this is set

setTimeout

public void setTimeout(int newTimeout)
sets the timeout. This makes timeout() valid

stream

public java.io.DataInputStream stream()
The stream for reading the contents of this packet