java.lang.Object edu.gwu.simplenetsim.NetsimPacket edu.gwu.simplenetsim.TransportPacket
public class TransportPacket
This is the packet that is handled by the transport layer and, for simplicity, the application layer as well. Fields can be set by the constructor or directly.
NetsimPacket
Field Summary | |
---|---|
int |
connID
The connection identifier. |
java.lang.String |
data
The payload is a string. |
int |
dest
Destination node ID. |
int |
portNum
Receiving port number. |
int |
seqnum
Sequence numbers are used by protocols. |
int |
src
Source node ID. |
Fields inherited from class edu.gwu.simplenetsim.NetsimPacket |
---|
CIRCLE, IDCount, SQUARE |
Constructor Summary | |
---|---|
TransportPacket()
Optional empty constructor. |
|
TransportPacket(int connID,
int src,
int dest,
int portNum,
java.lang.String data)
Constructor: Creates a new TransportPacket instance. |
Method Summary | |
---|---|
java.lang.String |
toString()
For debugging. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int connID
public int src
public int dest
public java.lang.String data
public int seqnum
public int portNum
Constructor Detail |
---|
public TransportPacket(int connID, int src, int dest, int portNum, java.lang.String data)
TransportPacket
instance.
connID
- an int
valuesrc
- an int
valuedest
- an int
valueportNum
- an int
valuedata
- a String
valuepublic TransportPacket()
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
String
value