C# 클래스 BlottoBeats.Library.Networking.Message

Message helper class for to clog the tubes with. Use Message.Send() to send a message and Message.Receive() to receive it. Used to send and receive objects directly.
파일 보기 프로젝트 열기: Zwolf11/BlottoBeats

공개 메소드들

메소드 설명
Pack ( object obj ) : byte[]

Packs an object into a big-endian byte array

Recieve ( NetworkStream stream ) : object

Receieves a single object over the specified stream

Send ( NetworkStream stream, object obj ) : void

Sends a single object over the specified stream

Test ( NetworkStream stream ) : bool

Tests a connection to see if it is valid

TestMsg ( NetworkStream stream ) : void

Sends a blank message with length header of zero.

Unpack ( byte data ) : object

Unpacks a big-endian byte array into an object

메소드 상세

Pack() 공개 정적인 메소드

Packs an object into a big-endian byte array
public static Pack ( object obj ) : byte[]
obj object Object to pack
리턴 byte[]

Recieve() 공개 정적인 메소드

Receieves a single object over the specified stream
public static Recieve ( NetworkStream stream ) : object
stream System.Net.Sockets.NetworkStream Stream to receive the message from
리턴 object

Send() 공개 정적인 메소드

Sends a single object over the specified stream
public static Send ( NetworkStream stream, object obj ) : void
stream System.Net.Sockets.NetworkStream Stream to send the message over
obj object Object to send
리턴 void

Test() 공개 정적인 메소드

Tests a connection to see if it is valid
public static Test ( NetworkStream stream ) : bool
stream System.Net.Sockets.NetworkStream Stream to test
리턴 bool

TestMsg() 공개 정적인 메소드

Sends a blank message with length header of zero.
public static TestMsg ( NetworkStream stream ) : void
stream System.Net.Sockets.NetworkStream
리턴 void

Unpack() 공개 정적인 메소드

Unpacks a big-endian byte array into an object
public static Unpack ( byte data ) : object
data byte
리턴 object