Interface IProtocol
Interface that contains methods to select the appropriate request and response handlers for a given protocol.
Namespace: Fibula.Communications.Contracts.Abstractions
Assembly: Fibula.Communications.Contracts.dll
Syntax
public interface IProtocol
Methods
| Improve this Doc View SourceByteToIncomingPacketType(Byte)
Attempts to convert a byte value into a IncomingPacketType.
Declaration
IncomingPacketType ByteToIncomingPacketType(byte fromByte)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | fromByte | The byte to convert. |
Returns
Type | Description |
---|---|
IncomingPacketType | The IncomingPacketType value converted to. |
RegisterPacketReader(IncomingPacketType, IPacketReader)
Registers a packet reader to this protocol.
Declaration
void RegisterPacketReader(IncomingPacketType forType, IPacketReader packetReader)
Parameters
Type | Name | Description |
---|---|---|
IncomingPacketType | forType | The type of packet to register for. |
IPacketReader | packetReader | The packet reader to register. |
RegisterPacketWriter(OutgoingPacketType, IPacketWriter)
Registers a packet writer to this protocol.
Declaration
void RegisterPacketWriter(OutgoingPacketType forType, IPacketWriter packetWriter)
Parameters
Type | Name | Description |
---|---|---|
OutgoingPacketType | forType | The type of packet to register for. |
IPacketWriter | packetWriter | The packet writer to register. |
SelectPacketReader(IncomingPacketType)
Selects the most appropriate packet reader for the specified type.
Declaration
IPacketReader SelectPacketReader(IncomingPacketType forPacketType)
Parameters
Type | Name | Description |
---|---|---|
IncomingPacketType | forPacketType | The type of packet. |
Returns
Type | Description |
---|---|
IPacketReader | An instance of an IPacketReader implementation. |
SelectPacketWriter(OutgoingPacketType)
Selects the most appropriate packet writer for the specified type.
Declaration
IPacketWriter SelectPacketWriter(OutgoingPacketType forPacketType)
Parameters
Type | Name | Description |
---|---|---|
OutgoingPacketType | forPacketType | The type of packet. |
Returns
Type | Description |
---|---|
IPacketWriter | An instance of an IPacketWriter implementation. |