dodo
0.0.1
A C++ library to create containerized Linux services
|
The TCPListener listens, accepts connections and generates socket events to produce TCP work to a pool of TCPServer worker objects. More...
#include <tcplistener.hpp>
Data Structures | |
struct | Params |
Parameters affecting TCPListener behavior. More... | |
struct | SocketWork |
BaseSocket socket and state pair. More... | |
struct | Stats |
Load statisics. More... | |
Public Types | |
enum | SockState { SockState::None = 0, SockState::New = 1, SockState::Read = 2, SockState::Shut = 4 } |
BaseSocket lifecycle states. More... | |
Public Member Functions | |
TCPListener (const Address &address, const Params ¶ms) | |
Constructor. More... | |
TCPListener (const YAML::Node &yaml) | |
Constructor, read Address and params from the YAML::Node. More... | |
void | start (TCPServer *server) |
Start the TCPListener and initialize with a TCPServer implementation object. More... | |
void | stop () |
Request a stop on the TCPListener. More... | |
![]() | |
Thread () | |
Constructor. More... | |
virtual | ~Thread () |
Destructor. More... | |
double | getAvgBlkInRate () |
Get the average block in rate since thread start() More... | |
double | getAvgBlkOutRate () |
Get the average block out rate since thread start() More... | |
double | getAvgICtx () |
Get the average involuntary context switch rate since thread start() More... | |
double | getAvgMajFltRate () |
Get the average major fault rate since thread start() More... | |
double | getAvgMinFltRate () |
Get the average minor fault rate since thread start() More... | |
double | getAvgSysCPU () |
Get the average system mode cpu (cpu seconds/second) since thread start() More... | |
double | getAvgUserCPU () |
Get the average user mode cpu (cpu seconds/second) since thread start() More... | |
double | getAvgVCtx () |
Get the average voluntary context switch rate since thread start() More... | |
std::thread::id | getId () const |
Get the thread id. More... | |
double | getLastBlkInRate () |
Get last block in rate since last sample. More... | |
double | getLastBlkOutRate () |
Get last block out rate since last sample. More... | |
double | getLastICtx () |
Get involuntary context switch rate since last sample. More... | |
double | getLastMajFltRate () |
Get the major fault rate since last sample. More... | |
double | getLastMinFltRate () |
Get the minor fault rate since last sample. More... | |
double | getLastSysCPU () |
Get the system mode cpu (cpu seconds/second) since last sample. More... | |
double | getLastUserCPU () |
Get the user mode cpu (cpu seconds/second) since last sample. More... | |
double | getLastVCtx () |
Get voluntary context switch rate since last sample. More... | |
long | getMaxRSS () |
Get the maximum resident set size seen on the thread. More... | |
double | getRunTime () |
Time, in seconds, since thread start. More... | |
double | getSnapDiffTime () |
Time, in seconds, since last statistic update. More... | |
pid_t | getTID () const |
Return the tid. More... | |
void | snapRUsage () |
Take a snapshot of the thread's resource usage. More... | |
void | start () |
Start the thread. More... | |
void | wait () |
Wait for the thread to join the current thread / wait for the thread to finish. More... | |
Private Member Functions | |
void | addReceivedSentBytes (ssize_t r, ssize_t s) |
Add received bytes. More... | |
void | addServers () |
Add a server if work_q_sz_ exceeds servers.size() and servers_.size() < params_.maxservers. More... | |
void | cleanStoppedServers () |
Cleanup stopped TCPServers. More... | |
void | closeSocket (BaseSocket *socket) |
Tell the listener to close the socket. More... | |
void | construct (const Address &address, const Params ¶ms) |
Common constructor code. More... | |
void | logStats () |
Log TCPListener statistics to Logger::getLogger(). More... | |
void | pollAdd (const BaseSocket *s, uint32_t events) |
Add an epoll event for the BaseSocket. More... | |
void | pollDel (const BaseSocket *s) |
Delete the epoll event for the BaseSocket. More... | |
void | pollMod (const BaseSocket *s, uint32_t events) |
Modify an epoll event for the BaseSocket. More... | |
SocketWork * | popWork () |
Pop work. More... | |
void | pushWork (const SocketWork &work) |
Push work. More... | |
void | pushWork (int fd, SockState state) |
Push work. More... | |
void | releaseWork (const SocketWork &work) |
Called by a TCPServer to signal that the work has been handled and event detection on it can resume. More... | |
virtual void | run () |
Entrypoint, override of Thread::run() More... | |
void | throttle () |
Throttle the listener when work_q_sz_ exceeds params_.maxqdepth. More... | |
bool | waitForActivity (TCPServer *server) |
Called by the TCPServer, enters wait state until woken up by either a timeout or a notify by TCPListener that there are 1 or more requests to be handled. More... | |
Private Attributes | |
int | backlog_ |
The backlog (incoming connection queue before accept calls clearing it) used by listen. More... | |
threads::Mutex | clientmutex_ |
Protects both client_ and workload_. More... | |
std::map< int, SocketWork > | clients_ |
Map of file descriptors to SocketWork for all connected clients. More... | |
std::condition_variable | cv_signal_ |
Condition variable used to wakeup TCPServer threads with mutex mt_signal_. More... | |
int | epoll_fd_ |
The epoll interface file descriptor. More... | |
size_t | event_maxconnections_reached_ |
The number of times a connection was closed after accept because params_.maxconnectctions was reached. More... | |
uint32_t | hangup_event_mask_ |
The event mask for hangup events. More... | |
TCPServer * | init_server_ |
The initial TCPServer, which will live as long as the TCPListener runs, and is sued to create new TCPServers under load. More... | |
Stats | last_stats_ |
The last Stats. More... | |
Address | listen_address_ |
The listening address. More... | |
BaseSocket * | listen_socket_ |
The listening BaseSocket. More... | |
std::mutex | mt_signal_ |
Mutex used to wakeup TCPServer threads with condition variable cv_signal_. More... | |
struct timeval | now_ |
Frequently updated by a TCPListenerTimer with enough precision for its use. More... | |
threads::Mutex | now_mutex_ |
Synchronize access to now_. More... | |
Params | params_ |
TCPListener parameters. More... | |
struct timeval | prev_stat_time_ |
Time of previous statistics. More... | |
Stats | prev_stats_ |
The previous Stats. More... | |
uint32_t | read_event_mask_ |
The event mask for read events. More... | |
struct timeval | server_stopped_check_time_ |
Time of last check for stopped servers. More... | |
std::list< TCPServer * > | servers_ |
List of TCPServers. More... | |
struct timeval | stat_time_ |
Time of last statistics. More... | |
threads::Mutex | stats_mutex_ |
Protects prev_stats_, last_stats_. More... | |
bool | stop_server_ |
If true, the TCPListener will gracefully stop and finish. More... | |
struct timeval | warn_queue_time_ |
Time of last queueing warning. More... | |
std::atomic< unsigned long long > | work_q_sz_ |
The number of queued work items. More... | |
std::deque< SocketWork * > | workload_ |
Queue of sockets with work for TCPServer instances. More... | |
Friends | |
bool | operator& (const TCPListener::SockState &, const TCPListener::SockState &) |
Bitwise & on SocketWork. More... | |
const friend dodo::common::Puts & | operator<< (const dodo::common::Puts &, TCPListener::SockState) |
Nice-write to a Puts. More... | |
TCPListener::SockState & | operator^= (TCPListener::SockState &, TCPListener::SockState) |
Bitwise ^= on SocketWork. More... | |
TCPListener::SockState & | operator|= (TCPListener::SockState &, TCPListener::SockState) |
Bitwise |= on SocketWork. More... | |
class | TCPListenerTimer |
TCPListenerTimer needs access to now_ and now_mutex_. More... | |
class | TCPServer |
TCPServer needs access to several private definitions, data and methods. More... | |
Additional Inherited Members | |
![]() | |
struct rusage | prev_rusage_ |
Previous statistics. More... | |
struct timeval | prev_snap_time_ |
Time of previous statistics snapshot. More... | |
struct rusage | rusage_ |
Last statistics. More... | |
struct timeval | snap_time_ |
Time of last statistics snapshot. More... | |
struct timeval | start_time_ |
Time Thread started. More... | |
std::thread * | thread_ |
The std::tread object. More... | |
The TCPListener listens, accepts connections and generates socket events to produce TCP work to a pool of TCPServer worker objects.
Developers must implement a protocol by subclassing TCPServer. The produced by a TCPListener is either
The developer sub-classes TCPServer to implement a request-response protocol.
TCPListener uses the Linux epoll_wait interface to pick up socket events and distribute the work to TCPServers.
The TCPListener is started start( TCPServer *server ) with an initial TCPServer object. The TCPServer::addServer() method is used to spawn additional TCPServer objects up to Params.minservers when TCPListener::run() is invoked. The TCPListener will spawn TCPServer worker threads if the amount of pending work exceeds the number of existing TCPServer objects, up to Params.maxservers.
The TCPServer descendant class implements the details of handShake, readSocket and shutDown, and are each passed a SocketWork that needs to be serviced -a SocketWork specifies the socket and the event state it is in.
Sockets are set to non-blocking mode, and TCPServer::readSocket is not guaranteed to see a full request, data might arrive in multiple chunks.
For a given connection, a TCPServer descendant will cycle through
On connection errors and hangups call to shutDown will follow - the BaseSocket object passed to shutDown() is not destroyed yet, allowing TCPServer implementations to clean up failed connections.
Definition at line 126 of file tcplistener.hpp.
|
strong |
BaseSocket lifecycle states.
Enumerator | |
---|---|
None | Undefined / initial. |
New | New connection, TCPServer::handShake() will be called. |
Read | Data is ready to be read, TCPServer::readSocket() will be called. |
Shut | BaseSocket is hung up or in error, TCPServer::shutDown() will be called. |
Definition at line 260 of file tcplistener.hpp.
Constructor.
address | The address to listen on. |
params | The Params to use. |
Definition at line 157 of file tcplistener.cpp.
References construct().
dodo::network::TCPListener::TCPListener | ( | const YAML::Node & | yaml | ) |
Constructor, read Address and params from the YAML::Node.
yaml | The YAML::NOde to read the configuration from. |
Definition at line 215 of file tcplistener.cpp.
References construct(), dodo::network::Address::isValid(), and throw_Exception.
|
inlineprivate |
Add received bytes.
r | The received bytes to add. |
s | The sent bytes to add |
Definition at line 408 of file tcplistener.hpp.
References last_stats_, dodo::network::TCPListener::Stats::received, dodo::network::TCPListener::Stats::sent, and stats_mutex_.
Referenced by dodo::network::TCPServer::run().
|
private |
Add a server if work_q_sz_ exceeds servers.size() and servers_.size() < params_.maxservers.
Definition at line 488 of file tcplistener.cpp.
References dodo::network::TCPServer::addServer(), init_server_, log_Debug, dodo::network::TCPListener::Params::maxservers, params_, servers_, dodo::threads::Thread::start(), and work_q_sz_.
Referenced by run().
|
private |
Cleanup stopped TCPServers.
Definition at line 568 of file tcplistener.cpp.
References dodo::network::TCPServer::addServer(), cv_signal_, dodo::threads::Thread::getTID(), dodo::network::TCPServer::hasStopped(), init_server_, log_Debug, dodo::network::TCPListener::Params::minservers, now_, now_mutex_, params_, dodo::network::TCPListener::Params::server_idle_ttl_s, server_stopped_check_time_, servers_, dodo::threads::Thread::start(), and dodo::threads::Thread::wait().
Referenced by run().
|
private |
Tell the listener to close the socket.
socket | The socket to close. |
Definition at line 448 of file tcplistener.cpp.
References clientmutex_, clients_, dodo::network::BaseSocket::close(), dodo::network::BaseSocket::getFD(), and log_Debug.
Referenced by releaseWork(), and run().
|
private |
Common constructor code.
address | The address to listen on. |
params | The Params to use.* |
Definition at line 166 of file tcplistener.cpp.
References dodo::network::Address::asString(), backlog_, dodo::network::TCPListener::Params::cycle_max_throttles, dodo::common::SystemError::ecOK, dodo::common::fileReadInt(), dodo::network::Address::getAddressFamily(), hangup_event_mask_, init_server_, dodo::network::Address::isValid(), dodo::network::BaseSocket::listen(), listen_address_, listen_socket_, dodo::network::TCPListener::Params::listener_sleep_ms, log_Statistics, dodo::network::TCPListener::Params::maxconnections, dodo::network::TCPListener::Params::maxqdepth, dodo::network::TCPListener::Params::maxservers, dodo::network::TCPListener::Params::minservers, params_, dodo::network::TCPListener::Params::pollbatch, read_event_mask_, dodo::network::TCPListener::Params::receive_timeout_seconds, dodo::network::TCPListener::Params::recvbufsz, dodo::network::TCPListener::Params::send_timeout_seconds, dodo::network::TCPListener::Params::sendbufsz, dodo::network::TCPListener::Params::server_idle_ttl_s, dodo::network::BaseSocket::setBlocking(), dodo::network::BaseSocket::setReceiveBufSize(), dodo::network::BaseSocket::setReceiveTimeout(), dodo::network::BaseSocket::setReUseAddress(), dodo::network::BaseSocket::setReUsePort(), dodo::network::BaseSocket::setSendBufSize(), dodo::network::BaseSocket::setSendTimeout(), stop_server_, dodo::network::TCPListener::Params::throttle_sleep_us, throw_Exception, throw_SystemException, work_q_sz_, dodo::network::yaml_cycle_max_throttles, dodo::network::yaml_listener_sleep_ms, dodo::network::yaml_maxconnections, dodo::network::yaml_maxqdepth, dodo::network::yaml_maxservers, dodo::network::yaml_minservers, dodo::network::yaml_pollbatch, dodo::network::yaml_receive_timeout_seconds, dodo::network::yaml_recvbufsz, dodo::network::yaml_send_timeout_seconds, dodo::network::yaml_sendbufsz, dodo::network::yaml_server_idle_ttl_s, and dodo::network::yaml_throttle_sleep_us.
Referenced by TCPListener().
|
private |
Log TCPListener statistics to Logger::getLogger().
Definition at line 511 of file tcplistener.cpp.
References clients_, dodo::network::TCPListener::Stats::connections, event_maxconnections_reached_, dodo::threads::Thread::getLastBlkInRate(), dodo::threads::Thread::getLastBlkOutRate(), dodo::threads::Thread::getLastICtx(), dodo::threads::Thread::getLastMajFltRate(), dodo::threads::Thread::getLastMinFltRate(), dodo::threads::Thread::getLastSysCPU(), dodo::threads::Thread::getLastUserCPU(), dodo::threads::Thread::getLastVCtx(), dodo::threads::Thread::getMaxRSS(), dodo::common::getSecondDiff(), last_stats_, log_Statistics, log_Warning, dodo::network::TCPListener::Params::maxconnections, now_, now_mutex_, params_, prev_stat_time_, prev_stats_, dodo::network::TCPListener::Stats::received, dodo::network::TCPListener::Stats::requests, dodo::network::TCPListener::Stats::sent, servers_, dodo::threads::Thread::snapRUsage(), stat_time_, dodo::network::TCPListener::Params::stat_trc_interval_s, stats_mutex_, dodo::network::TCPListener::Stats::throttles, and work_q_sz_.
Referenced by run().
|
private |
Add an epoll event for the BaseSocket.
s | The BaseSocket |
events | The events to set (see man epoll_ctl). |
Definition at line 461 of file tcplistener.cpp.
References dodo::common::DebugObject::debugString(), epoll_fd_, dodo::network::BaseSocket::getFD(), log_Debug, and throw_SystemException.
Referenced by releaseWork().
|
private |
Delete the epoll event for the BaseSocket.
s | The BaseSocket |
Definition at line 479 of file tcplistener.cpp.
References dodo::common::DebugObject::debugString(), epoll_fd_, dodo::network::BaseSocket::getFD(), log_Debug, and throw_SystemException.
Referenced by pushWork().
|
private |
Modify an epoll event for the BaseSocket.
s | The BaseSocket |
events | The events to set (see man epoll_ctl). |
Definition at line 470 of file tcplistener.cpp.
References dodo::common::DebugObject::debugString(), epoll_fd_, dodo::network::BaseSocket::getFD(), log_Debug, and throw_SystemException.
|
private |
Pop work.
Definition at line 420 of file tcplistener.cpp.
References clientmutex_, clients_, dodo::common::DebugObject::debugString(), dodo::network::BaseSocket::getFD(), log_Debug, dodo::network::TCPListener::SocketWork::socket, dodo::network::TCPListener::SocketWork::state, and workload_.
Referenced by dodo::network::TCPServer::run().
|
private |
Push work.
work | The SocketWork to handle. |
Definition at line 408 of file tcplistener.cpp.
References clientmutex_, clients_, dodo::common::DebugObject::debugString(), dodo::network::BaseSocket::getFD(), log_Debug, New, pollDel(), dodo::network::TCPListener::SocketWork::socket, dodo::network::TCPListener::SocketWork::state, work_q_sz_, and workload_.
Referenced by run().
|
private |
Push work.
fd | The BaseSocket fieldescriptor. |
state | The state the BaseSocket is in. |
Definition at line 396 of file tcplistener.cpp.
References clientmutex_, clients_, log_Debug, New, pollDel(), work_q_sz_, and workload_.
|
private |
Called by a TCPServer to signal that the work has been handled and event detection on it can resume.
work | The SocketWork. |
Definition at line 435 of file tcplistener.cpp.
References clientmutex_, clients_, closeSocket(), dodo::common::DebugObject::debugString(), dodo::network::BaseSocket::getFD(), hangup_event_mask_, log_Debug, pollAdd(), read_event_mask_, Shut, dodo::network::TCPListener::SocketWork::socket, dodo::network::TCPListener::SocketWork::state, and work_q_sz_.
Referenced by dodo::network::TCPServer::run().
|
privatevirtual |
Entrypoint, override of Thread::run()
Implements dodo::threads::Thread.
Definition at line 236 of file tcplistener.cpp.
References dodo::network::BaseSocket::accept(), dodo::network::TCPServer::addServer(), addServers(), dodo::network::Address::asString(), cleanStoppedServers(), clientmutex_, clients_, dodo::network::BaseSocket::close(), closeSocket(), dodo::network::TCPListener::Stats::connections, cv_signal_, dodo::common::DebugObject::debugString(), epoll_fd_, event_maxconnections_reached_, dodo::network::BaseSocket::getFD(), dodo::network::BaseSocket::getPeerAddress(), init_server_, dodo::network::BaseSocket::isValid(), last_stats_, listen_socket_, dodo::network::TCPListener::Params::listener_sleep_ms, log_Debug, log_Error, log_Warning, logStats(), dodo::network::TCPListener::Params::maxconnections, dodo::network::TCPListener::Params::maxservers, dodo::network::TCPListener::Params::minservers, New, dodo::network::TCPServer::newConnectionData(), None, now_, now_mutex_, params_, dodo::network::TCPListener::Params::pollbatch, prev_stat_time_, pushWork(), Read, dodo::network::TCPListener::Params::receive_timeout_seconds, dodo::network::TCPListener::Stats::requests, dodo::network::TCPListener::Params::send_timeout_seconds, server_stopped_check_time_, servers_, dodo::network::BaseSocket::setBlocking(), dodo::network::BaseSocket::setReceiveTimeout(), dodo::network::BaseSocket::setSendTimeout(), dodo::network::BaseSocket::setTCPKeepAlive(), dodo::network::BaseSocket::setTCPNoDelay(), Shut, dodo::threads::Thread::start(), stat_time_, stats_mutex_, stop_server_, dodo::network::TCPListener::Params::tcp_keep_alive, throttle(), throw_SystemException, warn_queue_time_, dodo::common::Exception::what(), and work_q_sz_.
void dodo::network::TCPListener::start | ( | TCPServer * | server | ) |
Start the TCPListener and initialize with a TCPServer implementation object.
server | A TCPServer descendant as initial server. |
Definition at line 231 of file tcplistener.cpp.
References init_server_.
|
inline |
Request a stop on the TCPListener.
Call wait() to wait for the thread to actually be stopped.
Definition at line 305 of file tcplistener.hpp.
References stop_server_.
|
private |
Throttle the listener when work_q_sz_ exceeds params_.maxqdepth.
Definition at line 497 of file tcplistener.cpp.
References dodo::network::TCPListener::Params::cycle_max_throttles, last_stats_, dodo::network::TCPListener::Params::maxqdepth, params_, stats_mutex_, dodo::network::TCPListener::Params::throttle_sleep_us, dodo::network::TCPListener::Stats::throttles, and work_q_sz_.
Referenced by run().
|
private |
Called by the TCPServer, enters wait state until woken up by either a timeout or a notify by TCPListener that there are 1 or more requests to be handled.
server | The TCPServer calling this. |
Definition at line 224 of file tcplistener.cpp.
References cv_signal_, dodo::network::TCPListener::Params::listener_sleep_ms, mt_signal_, and params_.
Referenced by dodo::network::TCPServer::run().
|
friend |
Bitwise & on SocketWork.
self | the lvalue |
other | the rvalue |
Definition at line 595 of file tcplistener.hpp.
|
friend |
Nice-write to a Puts.
os | The output Puts |
state | The TCPListener::SockState to write. |
Definition at line 606 of file tcplistener.hpp.
|
friend |
Bitwise ^= on SocketWork.
self | the lvalue |
other | the rvalue |
Definition at line 585 of file tcplistener.hpp.
|
friend |
Bitwise |= on SocketWork.
self | the lvalue |
other | the rvalue |
Definition at line 575 of file tcplistener.hpp.
|
friend |
TCPListenerTimer needs access to now_ and now_mutex_.
Definition at line 554 of file tcplistener.hpp.
|
friend |
TCPServer needs access to several private definitions, data and methods.
Definition at line 559 of file tcplistener.hpp.
|
private |
The backlog (incoming connection queue before accept calls clearing it) used by listen.
Definition at line 439 of file tcplistener.hpp.
Referenced by construct().
|
private |
Protects both client_ and workload_.
Definition at line 449 of file tcplistener.hpp.
Referenced by closeSocket(), popWork(), pushWork(), releaseWork(), and run().
|
private |
Map of file descriptors to SocketWork for all connected clients.
The work is either in progress or last completed state.
Definition at line 467 of file tcplistener.hpp.
Referenced by closeSocket(), logStats(), popWork(), pushWork(), releaseWork(), and run().
|
private |
Condition variable used to wakeup TCPServer threads with mutex mt_signal_.
Definition at line 461 of file tcplistener.hpp.
Referenced by cleanStoppedServers(), run(), and waitForActivity().
|
private |
|
private |
The number of times a connection was closed after accept because params_.maxconnectctions was reached.
Definition at line 549 of file tcplistener.hpp.
Referenced by logStats(), and run().
|
private |
The event mask for hangup events.
This is the event mask for all error and hangup events, an event mode active whilst a read event for the socket is already queued for processing, so that errors may be caught without clearing any pending read events on the socket.
Definition at line 499 of file tcplistener.hpp.
Referenced by construct(), and releaseWork().
|
private |
The initial TCPServer, which will live as long as the TCPListener runs, and is sued to create new TCPServers under load.
Definition at line 428 of file tcplistener.hpp.
Referenced by addServers(), cleanStoppedServers(), construct(), run(), and start().
|
private |
The last Stats.
Definition at line 509 of file tcplistener.hpp.
Referenced by addReceivedSentBytes(), logStats(), run(), and throttle().
|
private |
|
private |
The listening BaseSocket.
Definition at line 433 of file tcplistener.hpp.
Referenced by construct(), and run().
|
private |
Mutex used to wakeup TCPServer threads with condition variable cv_signal_.
Definition at line 455 of file tcplistener.hpp.
Referenced by waitForActivity().
|
private |
Frequently updated by a TCPListenerTimer with enough precision for its use.
Definition at line 544 of file tcplistener.hpp.
Referenced by cleanStoppedServers(), logStats(), and run().
|
private |
Synchronize access to now_.
Definition at line 539 of file tcplistener.hpp.
Referenced by cleanStoppedServers(), logStats(), and run().
|
private |
TCPListener parameters.
Definition at line 422 of file tcplistener.hpp.
Referenced by addServers(), cleanStoppedServers(), construct(), logStats(), run(), throttle(), and waitForActivity().
|
private |
Time of previous statistics.
Definition at line 524 of file tcplistener.hpp.
Referenced by logStats(), and run().
|
private |
|
private |
The event mask for read events.
This is the one-shot event mask for incoming data.
Definition at line 492 of file tcplistener.hpp.
Referenced by construct(), and releaseWork().
|
private |
Time of last check for stopped servers.
Definition at line 534 of file tcplistener.hpp.
Referenced by cleanStoppedServers(), and run().
|
private |
List of TCPServers.
Definition at line 472 of file tcplistener.hpp.
Referenced by addServers(), cleanStoppedServers(), logStats(), and run().
|
private |
Time of last statistics.
Definition at line 529 of file tcplistener.hpp.
Referenced by logStats(), and run().
|
private |
Protects prev_stats_, last_stats_.
Definition at line 514 of file tcplistener.hpp.
Referenced by addReceivedSentBytes(), logStats(), run(), and throttle().
|
private |
If true, the TCPListener will gracefully stop and finish.
Definition at line 444 of file tcplistener.hpp.
Referenced by construct(), run(), and stop().
|
private |
|
private |
The number of queued work items.
Definition at line 482 of file tcplistener.hpp.
Referenced by addServers(), construct(), logStats(), pushWork(), releaseWork(), run(), and throttle().
|
private |
Queue of sockets with work for TCPServer instances.
Definition at line 477 of file tcplistener.hpp.
Referenced by popWork(), and pushWork().