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.
Показать файл Открыть проект

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

Метод Описание
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