#include <TelnetServer.hpp>
Public Member Functions | |
TelnetServer ()=default | |
Constructor for server. | |
TelnetServer (const TelnetServer &)=delete | |
Copy constructor. | |
TelnetServer (TelnetServer &&)=delete | |
Move constructor. | |
TelnetServer & | operator= (TelnetServer)=delete |
Copy assignment operator. | |
TelnetServer & | operator= (TelnetServer &&)=delete |
Move assignment operator. | |
~TelnetServer () | |
Destructor for server. | |
bool | initialise (unsigned long listenPort, const std::shared_ptr< std::atomic_flag > &checkFlag, std::string promptString="", const std::shared_ptr< prometheus::Registry > ®=nullptr, const std::string &prependName="") |
void | shutdown () |
Closes the Telnet Server. | |
void | connectedCallback (FPTR_ConnectedCallback func) |
FPTR_ConnectedCallback | connectedCallback () const |
void | newLineCallback (FPTR_NewLineCallback func) |
FPTR_NewLineCallback | newLineCallBack () const |
void | tabCallback (FPTR_TabCallback func) |
FPTR_TabCallback | tabCallback () const |
const VEC_SP_TelnetSession & | sessions () const |
bool | interactivePrompt () const |
void | promptString (const std::string_view &prompt) |
const std::string & | promptString () const |
Private Member Functions | |
bool | acceptConnection () |
void | threadFunc () noexcept |
void | update () |
Process new connections and messages. | |
Private Attributes | |
FPTR_ConnectedCallback | m_connectedCallback |
FPTR_NewLineCallback | m_newlineCallback |
FPTR_TabCallback | m_tabCallback |
unsigned long | m_listenPort {} |
Socket | m_listenSocket {-1} |
VEC_SP_TelnetSession | m_sessions |
bool | m_initialised {false} |
std::string | m_promptString |
std::unique_ptr< TelnetStats > | m_stats |
std::atomic_flag | m_shouldStop {false} |
std::unique_ptr< std::thread > | m_serverThread |
std::shared_ptr< std::atomic_flag > | m_checkFlag |
Definition at line 130 of file TelnetServer.hpp.
|
default |
Constructor for server.
|
delete |
Copy constructor.
|
delete |
Move constructor.
TelnetServer::~TelnetServer | ( | ) |
Destructor for server.
Definition at line 540 of file TelnetServer.cpp.
|
private |
Definition at line 631 of file TelnetServer.cpp.
|
inline |
Definition at line 167 of file TelnetServer.hpp.
|
inline |
Definition at line 166 of file TelnetServer.hpp.
bool TelnetServer::initialise | ( | unsigned long | listenPort, |
const std::shared_ptr< std::atomic_flag > & | checkFlag, | ||
std::string | promptString = "", | ||
const std::shared_ptr< prometheus::Registry > & | reg = nullptr, | ||
const std::string & | prependName = "" ) |
Initializes a new Telnet server
[in] | listenPort | Port to listen |
[in] | promptString | Prompt string for connected users |
[in] | reg | Prometheus registry for stats |
[in] | prependName | Prefix for Prometheus stats |
Definition at line 560 of file TelnetServer.cpp.
|
inline |
Definition at line 177 of file TelnetServer.hpp.
|
inline |
Definition at line 170 of file TelnetServer.hpp.
|
inline |
Definition at line 169 of file TelnetServer.hpp.
|
delete |
Move assignment operator.
|
delete |
Copy assignment operator.
|
inline |
|
inline |
Definition at line 178 of file TelnetServer.hpp.
|
inline |
Definition at line 175 of file TelnetServer.hpp.
void TelnetServer::shutdown | ( | ) |
Closes the Telnet Server.
Definition at line 742 of file TelnetServer.cpp.
|
inline |
Definition at line 173 of file TelnetServer.hpp.
|
inline |
Definition at line 172 of file TelnetServer.hpp.
|
privatenoexcept |
Definition at line 655 of file TelnetServer.cpp.
|
private |
Process new connections and messages.
Definition at line 677 of file TelnetServer.cpp.
|
private |
Runtime check flag
Definition at line 207 of file TelnetServer.hpp.
|
private |
Definition at line 183 of file TelnetServer.hpp.
|
private |
Definition at line 198 of file TelnetServer.hpp.
|
private |
Definition at line 195 of file TelnetServer.hpp.
|
private |
Definition at line 196 of file TelnetServer.hpp.
|
private |
Definition at line 185 of file TelnetServer.hpp.
|
private |
Definition at line 200 of file TelnetServer.hpp.
|
private |
Thread handler
Definition at line 206 of file TelnetServer.hpp.
|
private |
Definition at line 197 of file TelnetServer.hpp.
|
private |
|
private |
Definition at line 203 of file TelnetServer.hpp.
|
private |
Definition at line 187 of file TelnetServer.hpp.