CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
Loading...
Searching...
No Matches
cmlabs::TelnetProtocol Class Reference

Telnet line protocol handler for interactive text connections. More...

#include <NetworkProtocols.h>

Inheritance diagram for cmlabs::TelnetProtocol:
[legend]
Collaboration diagram for cmlabs::TelnetProtocol:
[legend]

Public Member Functions

 TelnetProtocol ()
Public Member Functions inherited from cmlabs::NetworkProtocol
 NetworkProtocol ()

Static Public Member Functions

static bool CheckBufferForCompatibility (const char *buffer, uint32 length)
static bool InitialiseConversation (NetworkConnection *con)
 Send any initial prompt/negotiation.
static bool SendTelnetLine (NetworkConnection *con, TelnetLine *line)
 Send one line (with its line ending).
static TelnetLineReceiveTelnetLine (NetworkConnection *con, uint32 timeout)
 Read one line terminated by CR/LF.
static TelnetLineReceiveTelnetLine (NetworkConnection *con, uint32 timeout, uint32 size)
 Read a fixed number of bytes as one line (for raw/binary console input).
Static Public Member Functions inherited from cmlabs::NetworkProtocol
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.

Additional Inherited Members

Public Attributes inherited from cmlabs::NetworkProtocol
uint8 protocol
 PROTOCOL_* id of this handler.

Detailed Description

Telnet line protocol handler for interactive text connections.

Definition at line 908 of file NetworkProtocols.h.

Constructor & Destructor Documentation

◆ TelnetProtocol()

cmlabs::TelnetProtocol::TelnetProtocol ( )
inline

Definition at line 911 of file NetworkProtocols.h.

References cmlabs::NetworkProtocol::protocol, and PROTOCOL_TELNET.

Member Function Documentation

◆ CheckBufferForCompatibility()

bool cmlabs::TelnetProtocol::CheckBufferForCompatibility ( const char * buffer,
uint32 length )
static
Returns
true when buffer looks like plain line-oriented text.

Definition at line 2367 of file NetworkProtocols.cpp.

Referenced by cmlabs::NetworkChannel::ConnectionAutodetectRun().

◆ InitialiseConversation()

bool cmlabs::TelnetProtocol::InitialiseConversation ( NetworkConnection * con)
static

Send any initial prompt/negotiation.

Parameters
conConnection.
Returns
true on success.

Definition at line 2373 of file NetworkProtocols.cpp.

◆ ReceiveTelnetLine() [1/2]

TelnetLine * cmlabs::TelnetProtocol::ReceiveTelnetLine ( NetworkConnection * con,
uint32 timeout )
static

◆ ReceiveTelnetLine() [2/2]

TelnetLine * cmlabs::TelnetProtocol::ReceiveTelnetLine ( NetworkConnection * con,
uint32 timeout,
uint32 size )
static

Read a fixed number of bytes as one line (for raw/binary console input).

Parameters
conConnection.
timeoutMax wait in ms.
sizeExact byte count.
Returns
New TelnetLine owned by the caller, or NULL. Blocking.

Definition at line 2438 of file NetworkProtocols.cpp.

References cmlabs::TelnetLine::data, cmlabs::NetworkConnection::getRemoteAddress(), cmlabs::NetworkConnection::receive(), cmlabs::TelnetLine::size, and cmlabs::NetworkConnection::waitForDataToRead().

◆ SendTelnetLine()

bool cmlabs::TelnetProtocol::SendTelnetLine ( NetworkConnection * con,
TelnetLine * line )
static

Send one line (with its line ending).

Parameters
conConnection.
lineLine (caller keeps ownership).
Returns
true if sent.

Definition at line 2377 of file NetworkProtocols.cpp.

References cmlabs::TelnetLine::data, cmlabs::TelnetLine::getSize(), and cmlabs::NetworkConnection::send().

Referenced by cmlabs::NetworkChannel::sendReceiveTelnetLine(), and cmlabs::NetworkChannel::sendTelnetLine().


The documentation for this class was generated from the following files: