|
| | tcp_server_t (const std::string &interface, uint16_t port, mhaserver_t *mha) |
| |
| virtual bool | on_received_line (std::shared_ptr< mha_tcp::buffered_socket_t > c, const std::string &l) override |
| | This method is invoked when a line of text is received on one of the accepted connections. More...
|
| |
| | server_t (const std::string &interface, uint16_t port) |
| | Allocates a TCP server. More...
|
| |
| uint16_t | get_port () const |
| |
| asio::ip::tcp::endpoint | get_endpoint () const |
| |
| asio::ip::address | get_address () const |
| |
| size_t | get_num_accepted_connections () const |
| |
| void | run () |
| | Accepts connections on the TCP port and serves them. More...
|
| |
| virtual void | shutdown () |
| | Shuts down the server: Close the acceptor (no new connections), shuts down the receiving direction of all accepted connections (no new commands, but responses can still be finished), registers a timer event that will cause event loop termination and return from the run() method 1 second in the future, giving us reasonably enough time for the pending responses to be sent out. More...
|
| |
| virtual | ~server_t ()=default |
| | Make destructor virtual. More...
|
| |
| asio::io_context & | get_context () |
| |
◆ tcp_server_t()
| mhaserver_t::tcp_server_t::tcp_server_t |
( |
const std::string & |
interface, |
|
|
uint16_t |
port, |
|
|
mhaserver_t * |
mha |
|
) |
| |
|
inline |
◆ on_received_line()
| virtual bool mhaserver_t::tcp_server_t::on_received_line |
( |
std::shared_ptr< mha_tcp::buffered_socket_t > |
c, |
|
|
const std::string & |
l |
|
) |
| |
|
inlineoverridevirtual |
This method is invoked when a line of text is received on one of the accepted connections.
Override this method to process the communication with the client.
- Parameters
-
| c | the connection that has received this line |
| l | the line that has been received, without the line ending |
- Returns
- client should return true when client wants to read another line of text, else false.
Reimplemented from mha_tcp::server_t.
◆ mha
The documentation for this class was generated from the following file: