CLI  2.9
TelnetServer Class Referenceabstract

Telnet server class. More...

#include <telnet.h>

Inheritance diagram for TelnetServer:

Public Member Functions

 TelnetServer (const unsigned int UI_MaxConnections, const unsigned long UL_TcpPort, const ResourceString::LANG E_Lang)
 Constructor. More...
 
virtual ~TelnetServer (void)
 Destructor. More...
 
void StartServer (void)
 Starts the server. More...
 
void StopServer (void)
 Stops the server. More...
 
- Public Member Functions inherited from Object
virtual ~Object (void)=0
 Pure virtual destructor. More...
 

Protected Member Functions

virtual ExecutionContext *const OnNewConnection (const TelnetConnection &CLI_NewConnection)=0
 Execution context creation handler. More...
 
virtual void OnCloseConnection (const TelnetConnection &CLI_ConnectionClosed, ExecutionContext *const PCLI_Context)=0
 Execution context release handler. More...
 
- Protected Member Functions inherited from Object
 Object (void)
 Default constructor only available to sub-classes. More...
 

Detailed Description

Telnet server class.

Virtual object that shall be overridden for ExecutionContext (shell & cli basically) instance creations.

Warning
With the redesign of telnet connections, made as non blocking, this class had been redesigned in CLI 2.7, made virtual so that the user could create as many shells and clis for each connection. With the redesign of execution contexts, this class has been redesigned again in CLI 2.8, so that the user can create shells and clis, but also any other kind of execution contexts.

Definition at line 57 of file telnet.h.

Constructor & Destructor Documentation

◆ TelnetServer()

TelnetServer::TelnetServer ( const unsigned int  UI_MaxConnections,
const unsigned long  UL_TcpPort,
const ResourceString::LANG  E_Lang 
)
explicit

Constructor.

Parameters
UI_MaxConnectionsMaximum number of connections managed at the same time.
UL_TcpPortTCP port to listen onto.
E_LangDebugging language.

◆ ~TelnetServer()

virtual TelnetServer::~TelnetServer ( void  )
virtual

Destructor.

Member Function Documentation

◆ OnCloseConnection()

virtual void TelnetServer::OnCloseConnection ( const TelnetConnection CLI_ConnectionClosed,
ExecutionContext *const  PCLI_Context 
)
protectedpure virtual

Execution context release handler.

Parameters
CLI_ConnectionClosedTelnet connection being closed.
PCLI_ContextExecution context to be released.

◆ OnNewConnection()

virtual ExecutionContext* const TelnetServer::OnNewConnection ( const TelnetConnection CLI_NewConnection)
protectedpure virtual

Execution context creation handler.

Returns
Execution context created for the given connection.
Parameters
CLI_NewConnectionNew telnet connection to create a context for.

◆ StartServer()

void TelnetServer::StartServer ( void  )

Starts the server.

Warning
Blocking call.

◆ StopServer()

void TelnetServer::StopServer ( void  )

Stops the server.


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