All Packages Class Hierarchy This Package Previous Next Index
Class magician.Utils.UnsynchDatagramPacket
java.lang.Object
|
+----magician.Utils.UnsynchDatagramPacket
- public class UnsynchDatagramPacket
- extends Object
takes the
-
address
-
-
buf
-
-
length
-
-
MAX_DATAGRAM_PACKET_LEN
-
-
packetPool
-
-
port
-
-
UnsynchDatagramPacket(byte[], int, InetAddress, int)
- Constructs a datagram packet for sending packets of length
ilength
to the specified port number on the specified
host.
-
free(UnsynchDatagramPacket)
- release a datagram packet instance back to the free pool
-
getAddress()
- Returns the IP address of the machine to which this datagram is being
sent or from which the datagram was received.
-
getData()
- Returns the data received or the data to be sent.
-
getLength()
- Returns the length of the data to be sent or the length of the
data received.
-
getNewDatagramPacket()
- returns an initialized instance of a UnsynchDatagramPacket
-
getPort()
- Returns the port number on the remote host to which this datagram is
being sent or from which the datagram was received.
-
reinitialize()
- re-initializes the packet for reuse
idea taken from Singhal etal paper from IBM
TJ Watson Research Center
-
setAddress(InetAddress)
-
-
setData(byte[])
-
-
setLength(int)
-
-
setPort(int)
-
buf
byte buf[]
length
int length
address
InetAddress address
port
int port
MAX_DATAGRAM_PACKET_LEN
static final int MAX_DATAGRAM_PACKET_LEN
packetPool
static Vector packetPool
UnsynchDatagramPacket
public UnsynchDatagramPacket(byte ibuf[],
int ilength,
InetAddress iaddr,
int iport)
- Constructs a datagram packet for sending packets of length
ilength
to the specified port number on the specified
host. The length
argument must be less than or equal
to ibuf.length
.
- Parameters:
- ibuf - the packet data.
- ilength - the packet length.
- iaddr - the destination address.
- iport - the destination port number.
- See Also:
- InetAddress
getNewDatagramPacket
public static synchronized UnsynchDatagramPacket getNewDatagramPacket()
- returns an initialized instance of a UnsynchDatagramPacket
- Returns:
- an UnsynchDatagramPacket instance
free
public static synchronized void free(UnsynchDatagramPacket packet)
- release a datagram packet instance back to the free pool
- Parameters:
- UnsynchDatagramPacket - the instance to be returned
getAddress
public InetAddress getAddress()
- Returns the IP address of the machine to which this datagram is being
sent or from which the datagram was received.
- Returns:
- the IP address of the machine to which this datagram is being
sent or from which the datagram was received.
- See Also:
- InetAddress
getPort
public int getPort()
- Returns the port number on the remote host to which this datagram is
being sent or from which the datagram was received.
- Returns:
- the port number on the remote host to which this datagram is
being sent or from which the datagram was received.
getData
public byte[] getData()
- Returns the data received or the data to be sent.
- Returns:
- the data received or the data to be sent.
getLength
public int getLength()
- Returns the length of the data to be sent or the length of the
data received.
- Returns:
- the length of the data to be sent or the length of the
data received.
setAddress
public void setAddress(InetAddress iaddr)
setPort
public void setPort(int iport)
setData
public void setData(byte ibuf[])
setLength
public void setLength(int ilength)
reinitialize
public void reinitialize()
- re-initializes the packet for reuse
idea taken from Singhal etal paper from IBM
TJ Watson Research Center
All Packages Class Hierarchy This Package Previous Next Index