C# Класс NetworkCommsDotNet.PacketHeader

Contains information required to send, receive and correctly rebuild any objects sent via NetworkComms.Net. Any data sent via NetworkCommsDotNet is always preceded by a packetHeader.
Наследование: IExplicitlySerialize
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ContainsOption ( PacketHeaderLongItems option ) : bool

Check if a long option has been set.

ContainsOption ( PacketHeaderStringItems option ) : bool

Check if a string option has been set.

Deserialize ( Stream inputStream ) : void
Deserialize ( Stream inputStream, PacketHeader &result ) : void

Deserializes from a memory stream to a PacketHeader object

GetOption ( PacketHeaderLongItems option ) : long

Get a long option.

GetOption ( PacketHeaderStringItems options ) : string

Get a string option

PacketHeader ( string packetTypeStr, long payloadPacketSize, SendReceiveOptions sendReceiveOptions = null, string requestedReturnPacketTypeStr = null, string checkSumHash = null ) : System

Creates a new packetHeader

Serialize ( Stream outputStream ) : void
SetOption ( PacketHeaderLongItems option, long Value ) : void

Set a long option with the provided value.

SetOption ( PacketHeaderStringItems option, string Value ) : void

Set a string option with the provided value.

Приватные методы

Метод Описание
PacketHeader ( ) : System
PacketHeader ( MemoryStream packetHeaderStream, SendReceiveOptions headerSendReceiveOptions ) : System

Constructor used for deserialisation

Описание методов

ContainsOption() публичный Метод

Check if a long option has been set.
public ContainsOption ( PacketHeaderLongItems option ) : bool
option PacketHeaderLongItems The long option to be checked.
Результат bool

ContainsOption() публичный Метод

Check if a string option has been set.
public ContainsOption ( PacketHeaderStringItems option ) : bool
option PacketHeaderStringItems The string option to be checked.
Результат bool

Deserialize() публичный Метод

public Deserialize ( Stream inputStream ) : void
inputStream Stream
Результат void

Deserialize() публичный статический Метод

Deserializes from a memory stream to a PacketHeader object
public static Deserialize ( Stream inputStream, PacketHeader &result ) : void
inputStream Stream The memory stream containing the serialized
result PacketHeader The deserialized
Результат void

GetOption() публичный Метод

Get a long option.
public GetOption ( PacketHeaderLongItems option ) : long
option PacketHeaderLongItems The option to get
Результат long

GetOption() публичный Метод

Get a string option
public GetOption ( PacketHeaderStringItems options ) : string
options PacketHeaderStringItems The option to get
Результат string

PacketHeader() публичный Метод

Creates a new packetHeader
public PacketHeader ( string packetTypeStr, long payloadPacketSize, SendReceiveOptions sendReceiveOptions = null, string requestedReturnPacketTypeStr = null, string checkSumHash = null ) : System
packetTypeStr string The packet type to be used.
payloadPacketSize long The size on bytes of the payload
sendReceiveOptions SendReceiveOptions Send receive options which may contain header relevant options.
requestedReturnPacketTypeStr string An optional field representing the expected return packet type
checkSumHash string An optional field representing the payload checksum
Результат System

Serialize() публичный Метод

public Serialize ( Stream outputStream ) : void
outputStream Stream
Результат void

SetOption() публичный Метод

Set a long option with the provided value.
public SetOption ( PacketHeaderLongItems option, long Value ) : void
option PacketHeaderLongItems The option to set
Value long The option value
Результат void

SetOption() публичный Метод

Set a string option with the provided value.
public SetOption ( PacketHeaderStringItems option, string Value ) : void
option PacketHeaderStringItems The option to set
Value string The option value
Результат void