NCBI C++ ToolKit
Public Member Functions | Public Attributes | Static Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
CTcpDaemon Class Reference

Search Toolkit Book for CTcpDaemon

#include "tcp_daemon.hpp"
(Private to src/app/pubseq_gateway/server.)

+ Collaboration diagram for CTcpDaemon:

Public Member Functions

 CTcpDaemon (const std::string &Address, unsigned short Port, unsigned short NumWorkers, unsigned short BackLog, unsigned short MaxConnections)
 
void StopDaemonLoop (void)
 
bool OnRequest (CHttpProto **http_proto)
 
uint16_t NumOfConnections (void) const
 
unsigned short GetMaxConnections (void) const
 
void Run (CHttpDaemon &http_daemon, std::function< void(CTcpDaemon &daemon)> OnWatchDog=nullptr)
 

Public Attributes

CUvLoopm_UVLoop
 

Static Protected Attributes

static constexpr const char IPC_PIPE_NAME [] = "tcp_daemon_startup_rpc"
 

Private Member Functions

bool ClientConnected (void)
 
bool ClientDisconnected (void)
 

Static Private Member Functions

static void s_OnMainSigInt (uv_signal_t *, int)
 
static void s_OnMainSigTerm (uv_signal_t *, int)
 
static void s_OnMainSigHup (uv_signal_t *, int)
 
static void s_OnMainSigUsr1 (uv_signal_t *, int)
 
static void s_OnMainSigUsr2 (uv_signal_t *, int)
 
static void s_OnMainSigWinch (uv_signal_t *, int)
 

Private Attributes

std::string m_address
 
unsigned short m_port
 
unsigned short m_num_workers
 
unsigned short m_backlog
 
unsigned short m_max_connections
 
CTcpWorkersListm_workers
 
std::atomic_uint_fast16_t m_connection_count
 

Friends

class CTcpWorkersList
 
class CTcpWorker
 

Detailed Description

Definition at line 170 of file tcp_daemon.hpp.

Constructor & Destructor Documentation

◆ CTcpDaemon()

CTcpDaemon::CTcpDaemon ( const std::string Address,
unsigned short  Port,
unsigned short  NumWorkers,
unsigned short  BackLog,
unsigned short  MaxConnections 
)
inline

Definition at line 207 of file tcp_daemon.hpp.

Member Function Documentation

◆ ClientConnected()

bool CTcpDaemon::ClientConnected ( void  )
private

Definition at line 645 of file tcp_daemon.cpp.

References n.

◆ ClientDisconnected()

bool CTcpDaemon::ClientDisconnected ( void  )
private

Definition at line 652 of file tcp_daemon.cpp.

References n.

◆ GetMaxConnections()

unsigned short CTcpDaemon::GetMaxConnections ( void  ) const
inline

Definition at line 224 of file tcp_daemon.hpp.

References m_max_connections.

◆ NumOfConnections()

uint16_t CTcpDaemon::NumOfConnections ( void  ) const

Definition at line 681 of file tcp_daemon.cpp.

◆ OnRequest()

bool CTcpDaemon::OnRequest ( CHttpProto **  http_proto)

◆ Run()

void CTcpDaemon::Run ( CHttpDaemon http_daemon,
std::function< void(CTcpDaemon &daemon)>  OnWatchDog = nullptr 
)

◆ s_OnMainSigHup()

static void CTcpDaemon::s_OnMainSigHup ( uv_signal_t *  ,
int   
)
inlinestaticprivate

Definition at line 188 of file tcp_daemon.hpp.

References PSG_MESSAGE.

◆ s_OnMainSigInt()

void CTcpDaemon::s_OnMainSigInt ( uv_signal_t *  ,
int   
)
staticprivate

◆ s_OnMainSigTerm()

void CTcpDaemon::s_OnMainSigTerm ( uv_signal_t *  ,
int   
)
staticprivate

◆ s_OnMainSigUsr1()

static void CTcpDaemon::s_OnMainSigUsr1 ( uv_signal_t *  ,
int   
)
inlinestaticprivate

Definition at line 191 of file tcp_daemon.hpp.

References PSG_MESSAGE.

◆ s_OnMainSigUsr2()

static void CTcpDaemon::s_OnMainSigUsr2 ( uv_signal_t *  ,
int   
)
inlinestaticprivate

Definition at line 194 of file tcp_daemon.hpp.

References PSG_MESSAGE.

◆ s_OnMainSigWinch()

static void CTcpDaemon::s_OnMainSigWinch ( uv_signal_t *  ,
int   
)
inlinestaticprivate

Definition at line 197 of file tcp_daemon.hpp.

References PSG_MESSAGE.

◆ StopDaemonLoop()

void CTcpDaemon::StopDaemonLoop ( void  )

Definition at line 659 of file tcp_daemon.cpp.

Friends And Related Function Documentation

◆ CTcpWorker

friend class CTcpWorker
friend

Definition at line 182 of file tcp_daemon.hpp.

◆ CTcpWorkersList

friend class CTcpWorkersList
friend

Definition at line 181 of file tcp_daemon.hpp.

Member Data Documentation

◆ IPC_PIPE_NAME

constexpr const char CTcpDaemon::IPC_PIPE_NAME = "tcp_daemon_startup_rpc"
staticconstexprprotected

Definition at line 204 of file tcp_daemon.hpp.

◆ m_address

std::string CTcpDaemon::m_address
private

Definition at line 173 of file tcp_daemon.hpp.

◆ m_backlog

unsigned short CTcpDaemon::m_backlog
private

Definition at line 176 of file tcp_daemon.hpp.

◆ m_connection_count

std::atomic_uint_fast16_t CTcpDaemon::m_connection_count
private

Definition at line 179 of file tcp_daemon.hpp.

◆ m_max_connections

unsigned short CTcpDaemon::m_max_connections
private

Definition at line 177 of file tcp_daemon.hpp.

Referenced by GetMaxConnections().

◆ m_num_workers

unsigned short CTcpDaemon::m_num_workers
private

Definition at line 175 of file tcp_daemon.hpp.

◆ m_port

unsigned short CTcpDaemon::m_port
private

Definition at line 174 of file tcp_daemon.hpp.

◆ m_UVLoop

CUvLoop* CTcpDaemon::m_UVLoop

Definition at line 219 of file tcp_daemon.hpp.

◆ m_workers

CTcpWorkersList* CTcpDaemon::m_workers
private

Definition at line 178 of file tcp_daemon.hpp.


The documentation for this class was generated from the following files:
Modified on Thu May 30 12:26:09 2024 by modify_doxy.py rev. 669887