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

Variable Index

 o bytesReceived
 o DemuxQ
the demultiplexer queue on which incoming packets will be placed
 o DGpacketData
 o DGPacketRecv
datagram packet instance and its data buffer.
 o evm
Eventmanager to report events to
 o linkBandwidth
 o MAX_DATAGRAM_PACKET_LEN
 o packetcount
count of packets seen for statistics purposes
 o port
the port

Constructor Index

 o PortManager(int)
creates a new manager for the specified UDP port, list of names of virtual active nodes connected to it.

Method Index

 o getLinkBandwidth()
 o receive()
retrieves SmartPackets encapsulated inside ANEP protocol arriving over UDP port
 o run()

Variables

 o MAX_DATAGRAM_PACKET_LEN
 static int MAX_DATAGRAM_PACKET_LEN
 o linkBandwidth
 int linkBandwidth
 o DemuxQ
 public Queue DemuxQ
the demultiplexer queue on which incoming packets will be placed

 o port
 public int port
the port

 o DGPacketRecv
 DatagramPacket DGPacketRecv
datagram packet instance and its data buffer. The datagram packet instance is re-initialized for every invocation of the receive method

 o DGpacketData
 byte DGpacketData[]
 o packetcount
 public int packetcount
count of packets seen for statistics purposes

 o bytesReceived
 public int bytesReceived
 o evm
 EventManager evm
Eventmanager to report events to

Constructors

 o 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

Methods

 o getLinkBandwidth
 public int getLinkBandwidth()
 o 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
 o run
 public void run()

All Packages  Class Hierarchy  This Package  Previous  Next  Index
1