#include <senf/Utils/Console/Server.hh>
This class provides an interactive console TCP server.
Definition at line 63 of file Server.hh.
Public Types |
|
enum | Mode { Automatic, Interactive, Noninteractive } |
typedef detail::ServerHandle | ServerHandle |
Public Member Functions |
|
std::string const & | name () const |
Get server name. |
|
Server & | name (std::string const &name) |
Set server name. |
|
DirectoryNode & | root () const |
Get root node. |
|
Server & | root (DirectoryNode &root) |
Set root node. |
|
Mode | mode () const |
Get mode. |
|
Server & | mode (Mode mode) |
Set mode. |
|
void | stop () |
Stop the server. |
|
Static Public Member Functions |
|
static Server & | start (senf::INet4SocketAddress const &address) |
Start server on given IPv4 address/port. |
|
static Server & | start (senf::INet6SocketAddress const &address) |
Start server on given IPv6 address/port. |
typedef detail::ServerHandle senf::console::Server:: | ||||
ServerHandle | ||||
enum senf::console::Server:: | ||||
Mode | ||||
senf::console::Server & Server:: | ||||
mode | ( | Mode | mode | ) |
Set mode.
There are two Server types:
Automatic
(the default), a client connection is considered to be interactive if there is no data traffic in the first 500ms after the connection is opened.
Definition at line 92 of file Server.cci.
senf::console::Server::Mode Server:: | ||||
mode | () | |||
senf::console::Server & Server:: | ||||
name | ( | std::string const & | name | ) |
Set server name.
This information is used in the prompt string.
Definition at line 68 of file Server.cci.
std::string const & Server:: | ||||
name | () | |||
Get server name.
This information is used in the prompt string.
Definition at line 74 of file Server.cci.
senf::console::Server & Server:: | ||||
root | ( | DirectoryNode & | root | ) |
Set root node.
node will be the root node for all clients launched from this server.
Definition at line 86 of file Server.cci.
senf::console::DirectoryNode & Server:: | ||||
root | () | |||
Get root node.
Definition at line 80 of file Server.cci.
senf::console::Server & Server:: | ||||
start | ( | senf::INet6SocketAddress const & | address | ) |
senf::console::Server & Server:: | ||||
start | ( | senf::INet4SocketAddress const & | address | ) |
void Server:: | ||||
stop | () | |||
Stop the server.
All clients will be closed
Definition at line 104 of file Server.cci.