C# Class 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.
Afficher le fichier Open project: Zwolf11/BlottoBeats

Méthodes publiques

Méthode Description
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

Method Details

Pack() public static méthode

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

Recieve() public static méthode

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
Résultat object

Send() public static méthode

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
Résultat void

Test() public static méthode

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

TestMsg() public static méthode

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

Unpack() public static méthode

Unpacks a big-endian byte array into an object
public static Unpack ( byte data ) : object
data byte
Résultat object