All Packages Class Hierarchy This Package Previous Next Index
Class magician.Node.PortManager
java.lang.Object
|
+----java.net.DatagramSocket
|
+----magician.Node.PortManager
- public class PortManager
- extends DatagramSocket
- implements Runnable, PerfConstants
The PortManager is responsible for sending and receiving Active Network Encapsulation Protocol
(ANEP) packets over a UDP port. Each PortManager manages one UDP port. Received packets
are forwarded to the Demultiplxer by putting them on a queue read by the Demultiplexer. ANEP
packets are sent over the network by calling the send() method of the PortManager.
- See Also:
- Demultiplexer, Queue
-
bytesReceived
-
-
DemuxQ
- the demultiplexer queue on which incoming packets will be placed
-
DGpacketData
-
-
DGPacketRecv
- datagram packet instance and its data buffer.
-
evm
- Eventmanager to report events to
-
linkBandwidth
-
-
MAX_DATAGRAM_PACKET_LEN
-
-
packetcount
- count of packets seen for statistics purposes
-
port
- the port
-
PortManager(int)
- creates a new manager for the specified UDP port, list of names of virtual active nodes
connected to it.
-
getLinkBandwidth()
-
-
receive()
-
retrieves SmartPackets encapsulated inside ANEP protocol arriving over UDP port
-
run()
-
MAX_DATAGRAM_PACKET_LEN
static int MAX_DATAGRAM_PACKET_LEN
linkBandwidth
int linkBandwidth
DemuxQ
public Queue DemuxQ
- the demultiplexer queue on which incoming packets will be placed
port
public int port
- the port
DGPacketRecv
DatagramPacket DGPacketRecv
- datagram packet instance and its data buffer. The datagram packet instance
is re-initialized for every invocation of the receive method
DGpacketData
byte DGpacketData[]
packetcount
public int packetcount
- count of packets seen for statistics purposes
bytesReceived
public int bytesReceived
evm
EventManager evm
- Eventmanager to report events to
PortManager
public PortManager(int listenPort) throws SocketException
- creates a new manager for the specified UDP port, list of names of virtual active nodes
connected to it. The Portmanager receives datagram packets, extracts out the ANEP encapsulation
from the data and places the ANEP packet on the demultiplexer queue.
- Parameters:
- listenPort - the UDP port on which this port manager receives Smartpackets
- neighbors - a Hashtable containing the names of the neighboring nodes and their physical hosts
- See Also:
- Hashtable, Queue
getLinkBandwidth
public int getLinkBandwidth()
receive
public byte[] receive() throws IOException
- retrieves SmartPackets encapsulated inside ANEP protocol arriving over UDP port
- Returns:
- s an array of bytes comprising an ANEP encapsulated packet
run
public void run()
All Packages Class Hierarchy This Package Previous Next Index