My Project
Public Member Functions | Private Member Functions | Private Attributes | List of all members
uuid::telnet::TelnetService::Connection Class Reference

Telnet connection. More...

Collaboration diagram for uuid::telnet::TelnetService::Connection:
Collaboration graph
[legend]

Public Member Functions

 Connection (shell_factory_function &shell_factory, WiFiClient &&client, unsigned long idle_timeout, unsigned long write_timeout)
 Create a telnet connection shell. More...
 
bool loop ()
 Stop the shell if the client is not connected. More...
 
bool stop ()
 Stop the shell. More...
 

Private Member Functions

 Connection (const Connection &)=delete
 
Connectionoperator= (const Connection &)=delete
 

Private Attributes

WiFiClient client_
 
TelnetStream stream_
 
std::weak_ptr< uuid::console::Shellshell_
 
IPAddress addr_
 
uint16_t port_
 

Detailed Description

Telnet connection.

Holds the client and stream instance for the lifetime of the shell.

Since
0.1.0

Definition at line 378 of file telnet.h.

Constructor & Destructor Documentation

◆ Connection()

uuid::telnet::TelnetService::Connection::Connection ( shell_factory_function shell_factory,
WiFiClient &&  client,
unsigned long  idle_timeout,
unsigned long  write_timeout 
)

Create a telnet connection shell.

Parameters
[in]shell_factoryFunction to create a shell for new connections.
[in]clientClient connection.
[in]idle_timeoutIdle timeout in seconds.
[in]write_timeoutIdle timeout in milliseconds.
Since
0.1.0

Definition at line 177 of file telnet.cpp.

Member Function Documentation

◆ loop()

bool uuid::telnet::TelnetService::Connection::loop ( )

Stop the shell if the client is not connected.

Returns
Active status of the shell.
Since
0.1.0

Definition at line 210 of file telnet.cpp.

◆ stop()

bool uuid::telnet::TelnetService::Connection::stop ( )

Stop the shell.

Returns
True if the shell had not already stopped.
Since
0.2.0

Definition at line 230 of file telnet.cpp.

Member Data Documentation

◆ addr_

IPAddress uuid::telnet::TelnetService::Connection::addr_
private

Remote address of connection.

Since
0.1.0

Definition at line 414 of file telnet.h.

◆ client_

WiFiClient uuid::telnet::TelnetService::Connection::client_
private

Client connection.

Since
0.1.0

Definition at line 411 of file telnet.h.

◆ port_

uint16_t uuid::telnet::TelnetService::Connection::port_
private

Remote port of connection.

Since
0.1.0

Definition at line 415 of file telnet.h.

◆ shell_

std::weak_ptr<uuid::console::Shell> uuid::telnet::TelnetService::Connection::shell_
private

Shell for connection.

Since
0.2.0

Definition at line 413 of file telnet.h.

◆ stream_

TelnetStream uuid::telnet::TelnetService::Connection::stream_
private

Telnet stream for the connection.

Since
0.1.0

Definition at line 412 of file telnet.h.


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