Monkey Documentation

Class PacketPool<PacketType>

This is an internal base-class for BasicPacketPool and ReliablePacketPool, providing common functionality.


Extended by:
Constructors:
  • New ( PacketSize:Int, PoolSize:Int, FixByteOrder:Bool )
Properties:
Methods:

Constructor Documentation

Method New ( PacketSize:Int, PoolSize:Int, FixByteOrder:Bool )

  • The PacketSize argument specifies the size all allocated packets will be.
  • The PoolSize argument specifies how many 'PacketType' objects will be allocated initially.
  • The FixByteOrder argument specifies if network byte-order will be used.


Property Documentation

Method FixByteOrder : Bool () Property

This corresponds to the constructor argument of the same name. This property has protected assignment-access. See also: New

Method PacketSize : Int () Property

This corresponds to the constructor argument of the same name. This property has protected assignment-access. See also: New


Method Documentation

Method Allocate : Packet ()

This obtains a packet, then returns it. (Reference-count management and GeneratePacket)

Method BuildPool : Void ( PoolSize:Int )

This is an internal constructor used to initialize the pool; PoolSize specifies the number of initial objects. This constructor is protected.

Method Contains : Bool ( P:Packet )

This deduces if P is contained by this pool.

Method GeneratePacket : Packet ()

This is an abstract method used to generate a packet for internal management. This method is protected.

Method Release : Bool ( P:Packet )

This is used to release a handle to a 'PacketType' object. This will call Release, but expects the object to remain usable. For details, see Packet.New.