C# Class Crosschat.Server.Infrastructure.Protocol.CommandParser

It's a protocol like that: +-------+--------+-------------------------------+ |request| | | | name | len(4) | request body | | (4) | | | +-------+--------+-------------------------------+ request name: the name of the request, 4 chars, used for matching the processing command request data: the body of the request TODO: add isEncoded and isZipped flags
Afficher le fichier Open project: EgorBo/CrossChat-Xamarin.Forms Class Usage Examples

Méthodes publiques

Méthode Description
ParseBodyLength ( byte header, int offset, int length ) : int
ParseCommandName ( byte bytes ) : CommandNames
ToBytes ( Command command ) : byte[]
ToBytes ( CommandNames name, byte data ) : byte[]

Private Methods

Méthode Description
CommandNameToBytes ( CommandNames name ) : IEnumerable

Method Details

ParseBodyLength() public méthode

public ParseBodyLength ( byte header, int offset, int length ) : int
header byte
offset int
length int
Résultat int

ParseCommandName() public méthode

public ParseCommandName ( byte bytes ) : CommandNames
bytes byte
Résultat CommandNames

ToBytes() public méthode

public ToBytes ( Command command ) : byte[]
command Command
Résultat byte[]

ToBytes() public méthode

public ToBytes ( CommandNames name, byte data ) : byte[]
name CommandNames
data byte
Résultat byte[]