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.


Variable Index

 o MAX_DATAGRAM_PACKET_LEN
 o packetPool

Method Index

 o free(DatagramPacket)
release a datagram packet instance back to the free pool
 o getNewDatagramPacket()
returns an initialized instance of a UnsynchDatagramPacket
 o size()
returns the size of the Datagram packet pool

Variables

 o MAX_DATAGRAM_PACKET_LEN
 static final int MAX_DATAGRAM_PACKET_LEN
 o packetPool
 static Vector packetPool

Methods

 o getNewDatagramPacket
 public static synchronized DatagramPacket getNewDatagramPacket()
returns an initialized instance of a UnsynchDatagramPacket

Returns:
a DatagramPacket
 o 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
 o 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
1