#include <server.h>
Public Types | |
typedef ConexusPointer< Server > | pointer |
Public Member Functions | |
virtual | ~Server () |
virtual void | start () |
virtual void | start (bool use_dispatcher) |
virtual void | stop () |
virtual void | set_responsiveness (long r) |
Sets the responsiveness to add_*, remove_* and stop commands in microseconds; lower is more responsive; larger is less responsive; default is 500000 microseconds (or 500 ms). | |
virtual long | responsiveness () |
Returns the server responsiveness level. | |
virtual bool | is_running () |
sigc::signal< void, StartStop > | signal_start_stop () |
Protected Member Functions | |
Server () | |
virtual void | service_thread_main ()=0 |
virtual void | pre_start () |
virtual void | post_start () |
virtual void | pre_stop () |
virtual void | post_stop () |
virtual void | emit ()=0 |
Protected Attributes | |
Glib::Thread * | m_thread |
bool | m_terminate |
bool | m_running |
Glib::Dispatcher * | m_dispatcher |
bool | m_use_dispatcher |
struct timeval | m_timeval |
sigc::signal< void, StartStop > | m_signal_start_stop |
Private Member Functions | |
void | service_thread_main_proxy () |
void | emit_proxy () |
typedef ConexusPointer<Server> Conexus::Server::pointer |
Reimplemented from Conexus::Object.
Reimplemented in Conexus::EndpointServer, Conexus::IPv4::TCPServer, Conexus::IPv6::TCPServer, Conexus::SSL::IPv4::TCPServer, and Conexus::SSL::IPv6::TCPServer.
Conexus::Server::Server | ( | ) | [protected] |
References m_timeval.
virtual void Conexus::Server::emit | ( | ) | [protected, pure virtual] |
bool Conexus::Server::is_running | ( | ) | [virtual] |
References m_running.
virtual void Conexus::Server::post_start | ( | ) | [inline, protected, virtual] |
Referenced by start().
virtual void Conexus::Server::post_stop | ( | ) | [inline, protected, virtual] |
virtual void Conexus::Server::pre_start | ( | ) | [inline, protected, virtual] |
virtual void Conexus::Server::pre_stop | ( | ) | [inline, protected, virtual] |
Referenced by stop().
long Conexus::Server::responsiveness | ( | ) | [virtual] |
virtual void Conexus::Server::service_thread_main | ( | ) | [protected, pure virtual] |
Implemented in Conexus::IPv4::TCPServer, and Conexus::IPv6::TCPServer.
Referenced by service_thread_main_proxy().
void Conexus::Server::service_thread_main_proxy | ( | ) | [private] |
void Conexus::Server::set_responsiveness | ( | long | r | ) | [virtual] |
Sets the responsiveness to add_*, remove_* and stop commands in microseconds; lower is more responsive; larger is less responsive; default is 500000 microseconds (or 500 ms).
In general this refers to the timeout period of the select() call used internally. Each cycle of the server I/O thread acquires several mutex locks at the beginning of the cycle and releases them at the end of the cycle.
This value shortens the cycle period, thereby making the server more responsive to commands at the cost of increasing overhead.
References m_timeval.
sigc::signal< void, StartStop > Conexus::Server::signal_start_stop | ( | ) |
References m_signal_start_stop.
void Conexus::Server::start | ( | bool | use_dispatcher | ) | [virtual] |
void Conexus::Server::start | ( | ) | [virtual] |
References Conexus::use_dispatcher_default().
void Conexus::Server::stop | ( | ) | [virtual] |
References m_dispatcher, m_running, m_signal_start_stop, m_terminate, m_thread, post_stop(), pre_stop(), and Conexus::STOP.
Referenced by Conexus::EndpointServer::~EndpointServer(), and ~Server().
Glib::Dispatcher* Conexus::Server::m_dispatcher [protected] |
bool Conexus::Server::m_running [protected] |
sigc::signal<void,StartStop> Conexus::Server::m_signal_start_stop [protected] |
Referenced by signal_start_stop(), start(), and stop().
bool Conexus::Server::m_terminate [protected] |
Glib::Thread* Conexus::Server::m_thread [protected] |
struct timeval Conexus::Server::m_timeval [read, protected] |
bool Conexus::Server::m_use_dispatcher [protected] |
Referenced by Conexus::EndpointServer::queue_endpoint(), and start().