All Packages Class Hierarchy This Package Previous Next Index
Class magician.Utils.DatagramPacketPool
java.lang.Object
|
+----magician.Utils.DatagramPacketPool
- public class DatagramPacketPool
- extends Object
This class represents a datagram packet.
Datagram packets are used to implement a connectionless packet
delivery service. Each message is routed from one machine to
another based solely on information contained within that packet.
Multiple packets sent from one machine to another might be routed
differently, and might arrive in any order.
-
MAX_DATAGRAM_PACKET_LEN
-
-
packetPool
-
-
free(DatagramPacket)
- release a datagram packet instance back to the free pool
-
getNewDatagramPacket()
- returns an initialized instance of a UnsynchDatagramPacket
-
size()
- returns the size of the Datagram packet pool
MAX_DATAGRAM_PACKET_LEN
static final int MAX_DATAGRAM_PACKET_LEN
packetPool
static Vector packetPool
getNewDatagramPacket
public static synchronized DatagramPacket getNewDatagramPacket()
- returns an initialized instance of a UnsynchDatagramPacket
- Returns:
- a DatagramPacket
free
public static synchronized void free(DatagramPacket packet) throws IllegalAccessException
- release a datagram packet instance back to the free pool
- Parameters:
- packet - the datagram packet to be returned
- Throws: IllegalAccessException
- if free is called before allocating DatagramPacket
size
public static int size()
- returns the size of the Datagram packet pool
- Returns:
- the size of the pool
All Packages Class Hierarchy This Package Previous Next Index