Monkey Documentation

Class ReliablePacket

Reliable packets hold raw packet data, which is sent using Resend to a Client via Destination. More...


Extends:
Constructors:
  • New ( Size:Int, FixByteOrder:Bool=default_bigendianstorage, AutoClose:Bool=true )
Properties:
Methods:
Inherited Properties:
Inherited Methods:
Inherited Functions:

Detailed Discussion

Reliable packets hold raw packet data, which is sent using Resend to a Client via Destination. These are used internally by NetworkEngine objects, where management of Destination is done. It is not recommended to create instances of this class, unless you intend to right your own reliable/raw packet system. This class may not be extended. This is documented for the sake of understanding and/or extending the framework as a whole.

Constructor Documentation

Method New ( Size:Int, FixByteOrder:Bool=default_bigendianstorage, AutoClose:Bool=true )

  • The Size argument specifies the maximum size of the packet.
  • The FixByteOrder argument toggles network byte-order.
  • The AutoClose argument specifies if a call to Release is allowed to close this packet-stream.


Property Documentation

Method Destination : Client () Property

This represents a Client object supplied by a NetworkEngine. This is supplied through the assignment-overload. This property has protected assignment-access. Assignment is considered unsafe if this ReliablePacket is already being managed by a NetworkEngine; use at your own risk.

Method ID : PacketID () Property

This specifies the identifier attached to this reliable packet. This is assigned by a NetworkEngine, and is unique to this packet / its contents. This property has protected assignment-access.

Method IsReliable : Bool () Property

This will always return True. See also: The Packet class's IsReliable implementation.


Method Documentation

Method ForceReset : Void ()

For details, see the Packet class's implementation: ForceReset.

Method Resend : Void ( Network:NetworkEngine )

This resends the (Raw) contents of this packet to Destination, using Network. This will reset the internal resend-timer.

Method Update : Void ( Network:NetworkEngine )

This is called by NetworkEngine objects (Usually passing themselves as Network) to automate things like calling Resend. Internally, ReliablePacket objects hold resend-timers, this routine manages this timer, and calls Resend accordingly.