Abstraction and base class for packet-based protocols.
    public abstract class PacketPeer : Reference

PacketPeer is an abstraction and base class for packet-based protocols (such as UDP). It provides an API for sending and receiving packets both as raw data or variables. This makes it easy to transfer data over a protocol, without having to encode data as low level bytes or having to worry about network ordering.

Inheritance Chain

Derived Classes


    public bool AllowObjectDecoding { get; set; }


    public int GetAvailablePacketCount()

Return the number of packets currently available in the ring-buffer.

    public byte[] GetPacket()

Get a raw packet.

    public Error GetPacketError()

Return the error state of the last packet received (via GetPacket() and GetVar()).

    public object GetVar()

Get a Variant.

    public bool IsObjectDecodingAllowed()

Getter for AllowObjectDecoding

    public Error PutPacket(byte[] buffer)

Send a raw packet.

    public Error PutVar(object var)

Send a Variant as a packet.

    public void SetAllowObjectDecoding(bool enable)

Setter for AllowObjectDecoding