|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsimnet.Transport
simnet.UDP
An implementation of the UDP protocol.
| Field Summary | |
java.util.HashSet |
availablePorts
Added for NAT purposes :-( |
protected int |
next_port
|
(package private) java.util.Hashtable |
ports
|
(package private) java.util.HashSet |
sockets
|
| Fields inherited from class simnet.Transport |
node, NODE_ID, sim |
| Constructor Summary | |
UDP()
|
|
| Method Summary | |
DatagramSocket |
createDatagramSocket(java.lang.Object consumer)
Returns a new DatagramSocket using this transport. |
void |
dump_udp_state()
Print out all UDP state information. |
(package private) int |
getNextFreePort()
Return the next available port to bind to, or -1 if there is none. |
int |
getProtocol()
Returns the protocol (id) of this Transport |
void |
in(int src,
Packet packet)
In UDP, rawIn does all the work. |
void |
initialize(Node parent_node)
Initializes a new UDP object by setting its ID. |
boolean |
prePlugout(java.lang.Object replacement)
To replace UDP, update all sockets; to remove UDP, close all sockets. |
void |
rawIn(IP_Packet ipp)
Processes incoming packets from the IP stack and forwards the encapsulated data to the appropriate DatagramSocket. |
protected void |
registerSocket(DatagramSocket sock)
When a DatagramSocket gets created, UDP needs to know about it. |
(package private) void |
unregisterSocket(DatagramSocket sock)
When a DatagramSocket gets closed, UDP needs to know about it. |
| Methods inherited from class simnet.Transport |
finalize, plugoutNotification |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
java.util.HashSet sockets
java.util.Hashtable ports
protected int next_port
public java.util.HashSet availablePorts
| Constructor Detail |
public UDP()
| Method Detail |
public void initialize(Node parent_node)
initialize in class Transportparent_node - the Node that owns this Transportpublic int getProtocol()
getProtocol in class Transportpublic DatagramSocket createDatagramSocket(java.lang.Object consumer)
public void rawIn(IP_Packet ipp)
rawIn in class Transport
public void in(int src,
Packet packet)
in in class Transportsrc - the source of the incoing packetpacket - incoming packetint getNextFreePort()
protected void registerSocket(DatagramSocket sock)
void unregisterSocket(DatagramSocket sock)
public void dump_udp_state()
public boolean prePlugout(java.lang.Object replacement)
prePlugout in interface Pluggable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||