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
파일 보기 프로젝트 열기: MarcFletcher/NetworkComms.Net 1 사용 예제들

공개 메소드들

메소드 설명
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