|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
Base class for the protocol auto-detection framework. More...
#include <NetworkProtocols.h>
Public Member Functions | |
| NetworkProtocol () | |
Static Public Member Functions | |
| static bool | CheckBufferForCompatibility (const char *buffer, uint32 length) |
Sniff whether buffer looks like this protocol. | |
| static bool | InitialiseConversation (NetworkConnection *con) |
| Perform any protocol-specific initial exchange on a new connection. | |
Public Attributes | |
| uint8 | protocol |
| PROTOCOL_* id of this handler. | |
Base class for the protocol auto-detection framework.
Each protocol class implements static CheckBufferForCompatibility(), which sniffs the first bytes arriving on a fresh connection to decide whether they match its wire format, and InitialiseConversation() to perform any initial exchange. NetworkChannel::autoDetectConnection() uses these to multiplex several protocols on one listening port.
Definition at line 800 of file NetworkProtocols.h.
|
inline |
Definition at line 803 of file NetworkProtocols.h.
References protocol.
|
inlinestatic |
Sniff whether buffer looks like this protocol.
| buffer | First bytes received. |
| length | Byte count. |
Definition at line 807 of file NetworkProtocols.h.
|
inlinestatic |
Perform any protocol-specific initial exchange on a new connection.
| con | The fresh connection. |
Definition at line 810 of file NetworkProtocols.h.
| uint8 cmlabs::NetworkProtocol::protocol |
PROTOCOL_* id of this handler.
Definition at line 802 of file NetworkProtocols.h.
Referenced by cmlabs::HTTPClientProtocol::HTTPClientProtocol(), cmlabs::HTTPProtocol::HTTPProtocol(), cmlabs::MessageProtocol::MessageProtocol(), NetworkProtocol(), and cmlabs::TelnetProtocol::TelnetProtocol().