Type of connection closing.
Enumerator eOurCloseConnection closed by ourselves.
eClientCloseConnection closed by other peer.
Definition at line 268 of file server.hpp.
◆ EErrCode [1/2] Enumerator eBadParametersOut-of-range parameters given.
eCouldntListenUnable to bind listening port.
ePoolOverflowConnection pool overflowed.
Definition at line 467 of file server.hpp.
◆ EErrCode [2/2] Enumerator eBadParametersOut-of-range parameters given.
eCouldntListenUnable to bind listening port.
Definition at line 55 of file threaded_server.hpp.
◆ EListenActionWhat to do if the port is busy.
Enumerator eLAFail eLAIgnore eLARetryDefinition at line 391 of file server.hpp.
◆ EOverflowReasonError codes for OnOverflow method in IServer_ConnectionHandler.
Enumerator eOR_Unknown eOR_ConnectionPoolFull eOR_RequestQueueFull eOR_UnpollableSocketDefinition at line 209 of file server.hpp.
◆ EServerConnType Enumerator eInactiveSocket eActiveSocket eListener ePreDeferredSocket eDeferredSocket ePreClosedSocket eClosedSocketDefinition at line 49 of file server_connection.hpp.
◆ EServIO_EventExtended copy of the type EIO_Event allowing to distinguish between connection closing from client and from ourselves.
Enumerator eServIO_Open eServIO_Read eServIO_Write eServIO_ReadWriteeIO_Read | eIO_Write
eServIO_ClientClose eServIO_OurClose eServIO_Inactivity eServIO_Delete eServIO_AlarmDefinition at line 61 of file server.hpp.
◆ Activate() [1/2] virtual void IServer_ConnectionBase::Activate ( void ) inlinevirtual ◆ Activate() [2/2] virtual void CServer_Listener::Activate ( void ) inlinevirtual ◆ Add()Definition at line 99 of file connection_pool.cpp.
References abort(), conn, eListener, set< Key, Compare >::end(), set< Key, Compare >::find(), set< Key, Compare >::insert(), CServer_ConnectionPool::m_Data, CServer_ConnectionPool::m_ListeningStarted, CServer_ConnectionPool::m_MaxConnections, CServer_ConnectionPool::m_Mutex, CServer_ConnectionPool::PingControlConnection(), set< Key, Compare >::size(), type, and CServer_ConnectionPool::x_UpdateExpiration().
Referenced by CServer::AddConnectionToPool(), CServer::AddListener(), and CAcceptRequest::x_DoProcess().
◆ AddConnectionToPool()Add externally created connection to the connection pool which server polls on.
Throws exception if pool is full. NOTE: events to this connection can come theoretically even NOTE: if connection gets some error or its peer closes it then conn object will be deleted after processing OnClose event. If you don't want that you have to call RemoveConnectionFromPool while handling OnClose.
Definition at line 846 of file server.cpp.
References CServer_ConnectionPool::Add(), conn, eInactiveSocket, CServer::m_ConnectionPool, and NCBI_THROW.
◆ AddListener() ◆ CheckMessage() [1/2] virtual int IServer_LineMessageHandler::CheckMessage ( BUF * buffer, const void * data, size_t size ) inlinevirtual ◆ CheckMessage() [2/2] virtual int IServer_MessageHandler::CheckMessage ( BUF * buffer, const void * data, size_t size ) pure virtual ◆ CloseConnection() [1/2] void CServer::CloseConnection ( CSocket * sock )Close connection.
Method should be called only when closing is initiated by server itself, because it will generate then event eServIO_OurClose.
Definition at line 664 of file server.cpp.
References CServer_ConnectionPool::CloseConnection(), and CServer::m_ConnectionPool.
Referenced by CNetScheduleHandler::OnMessage(), CNetStorageHandler::OnRead(), CNetScheduleHandler::x_HandleSocketErrorOnResponse(), CNetScheduleHandler::x_OnCmdParserError(), CNetStorageHandler::x_OnMessage(), CNetStorageHandler::x_OnSocketWriteError(), CNetScheduleHandler::x_PrepareWriteBuffer(), CNetScheduleHandler::x_ProcessMsgAuth(), CNetScheduleHandler::x_ProcessMsgQueue(), CNetScheduleHandler::x_ProcessQuitSession(), CNetStorageHandler::x_ReadRawData(), and CNetScheduleHandler::x_WriteMessage().
◆ CloseConnection() [2/2] void CServer_ConnectionPool::CloseConnection ( TConnBase * conn )Close connection as if it was initiated by server (not by client).
Definition at line 212 of file connection_pool.cpp.
References CSocket::Abort(), conn, Critical(), eActiveSocket, ePreClosedSocket, ePreDeferredSocket, ERR_POST, eServIO_OurClose, g_ServerConnTypeToString(), and CServer_Connection::OnSocketEvent().
Referenced by CServer::CloseConnection(), and CServerConnectionRequest::x_Process().
◆ Create() [1/2]template<class TServer_ConnectionHandler >
◆ Create() [2/2] ◆ CreateRequest() [1/3] ◆ CreateRequest() [2/3] ◆ CreateRequest() [3/3] ◆ CServer() CServer::CServer ( void ) ◆ CServer_Connection() ◆ CServer_ConnectionPool() CServer_ConnectionPool::CServer_ConnectionPool ( unsigned max_connections )Definition at line 58 of file connection_pool.cpp.
◆ CServer_Listener() ◆ CServer_Monitor() [1/2] CServer_Monitor::CServer_Monitor ( ) ◆ CServer_Monitor() [2/2] ◆ DeferConnectionProcessing() [1/2] void CServer::DeferConnectionProcessing ( CSocket * sock ) ◆ DeferConnectionProcessing() [2/2] ◆ Erase() void CServer_ConnectionPool::Erase ( void ) ◆ Exit() virtual void CServer::Exit ( void ) inlineprotectedvirtualCleanup the server.
Called by Run method after poll cycle when all processing threads are stopped, but before releasing listening ports. Here you're still guaranteed that another instance running on the same set of ports will fail at StartListening point.
Reimplemented in CNetStorageServer, and CNetScheduleServer.
Definition at line 181 of file server.hpp.
Referenced by CServer::Run().
◆ g_ServerConnTypeToString() ◆ GetErrCodeString() [1/2] const char * CServer_Exception::GetErrCodeString ( void ) const overridevirtual ◆ GetErrCodeString() [2/2] const char * CThreadedServerException::GetErrCodeString ( void ) const overridevirtual ◆ GetEventsToPollFor() [1/3] ◆ GetEventsToPollFor() [2/3]Following three methods are guaranteed to be called NOT at the same time as On*, so if you implement them you should not guard the variables which they can use with mutexes.
Reimplemented in CNetStorageHandler.
Definition at line 239 of file server.hpp.
References eIO_Read.
◆ GetEventsToPollFor() [3/3] ◆ GetListenerPorts() [1/2] vector< unsigned short > CServer::GetListenerPorts ( void ) ◆ GetListenerPorts() [2/2] vector< unsigned short > CServer_ConnectionPool::GetListenerPorts ( void ) ◆ GetParameters() ◆ GetPollAndTimerVec()Definition at line 232 of file connection_pool.cpp.
References _ASSERT, CTime::DiffTimeSpan(), eActiveSocket, eClosedSocket, eDeferredSocket, CTime::eEmpty, eInactiveSocket, eIO_Read, eListener, set< Key, Compare >::erase(), ERASE_ITERATE, IServer_ConnectionBase::expiration, CTimeSpan::GetCompleteSeconds(), IServer_ConnectionBase::GetEventsToPollFor(), GetFastLocalTime(), CTimeSpan::GetNanoSecondsAfterSecond(), CServer_Listener::GetPort(), IServer_ConnectionBase::IsOpen(), IServer_ConnectionBase::IsReadyToProcess(), CFastMutex::Lock(), CServer_ConnectionPool::m_ControlTrigger, CServer_ConnectionPool::m_Data, CServer_ConnectionPool::m_ListenerPortsToStop, CServer_ConnectionPool::m_Mutex, NULL, CGuard< Resource, Lock, Unlock, ReportExceptions >::Release(), STimeoutTag::sec, IServer_ConnectionBase::type, IServer_ConnectionBase::type_lock, CFastMutex::Unlock(), and STimeoutTag::usec.
Referenced by CServer::x_DoRun().
◆ GetPort() [1/2] unsigned short GetPort ( void ) constGet the listening port number back.
Definition at line 107 of file threaded_server.hpp.
References m_Port.
Referenced by CSeqGraphicPane::AdjustViewPort(), CSeqGraphicPane::AdjustViewPortHeightToImage(), CGlWidgetDemo::CGlWidgetDemo(), CNetScheduleNotificationHandler::CmdAppendTimeoutGroupAndClientInfo(), GetPeerIpAndPort(), CHitMatrixPane::OnSize(), CHitMatrixPane::RenderVectorGraphics(), CNetScheduleNotificationHandler::RequestJobWatching(), CSeqGraphicPane::SetHorizontal(), CNetScheduleNotificationHandler::SubmitJob(), CHitMatrixPane::Update(), CSeqGraphicPane::x_Render(), and CHitMatrixPane::x_RenderContent().
◆ GetPort() [2/2] unsigned short CServer_Listener::GetPort ( void ) const inline ◆ GetSocket() CSocket& IServer_ConnectionHandler::GetSocket ( void ) inlineGet underlying socket.
Definition at line 294 of file server.hpp.
References IServer_ConnectionHandler::m_Socket.
Referenced by CRelocateCallback::Callback(), CNetScheduleHandler::OnClose(), CNetStorageHandler::OnClose(), CBDBEnvKeeperConnectionHandler::OnMessage(), CNetScheduleHandler::OnMessage(), CWNCTConnectionHandler::OnMessage(), CBDBEnvKeeperConnectionHandler::OnOpen(), CNetScheduleHandler::OnOpen(), CNetStorageHandler::OnOpen(), CWNCTConnectionHandler::OnOpen(), IServer_MessageHandler::OnRead(), CNetStorageHandler::OnRead(), CNetScheduleHandler::x_CreateConnContext(), CNetStorageHandler::x_CreateConnContext(), CNetScheduleHandler::x_GetPeerAddress(), CNetStorageHandler::x_GetPeerAddress(), CNetScheduleHandler::x_HandleSocketErrorOnResponse(), CNetScheduleHandler::x_OnCmdParserError(), CNetStorageHandler::x_OnMessage(), CNetStorageHandler::x_OnSocketWriteError(), CNetScheduleHandler::x_PrepareWriteBuffer(), CNetScheduleHandler::x_PrintCmdRequestStart(), CNetStorageHandler::x_PrintMessageRequestStart(), CNetScheduleHandler::x_ProcessMsgAuth(), CNetScheduleHandler::x_ProcessMsgBatchJob(), CNetScheduleHandler::x_ProcessMsgQueue(), CNetScheduleHandler::x_ProcessMsgRequest(), CNetScheduleHandler::x_ProcessQuitSession(), CWNCTConnectionHandler::x_ProcessRequest(), CNetScheduleHandler::x_ProcessStatistics(), CNetStorageHandler::x_ReadRawData(), CNetStorageHandler::x_SendOutputBuffer(), CNetStorageHandler::x_SendOverUTTP(), CNetScheduleHandler::x_SetQuickAcknowledge(), CNetStorageHandler::x_SetQuickAcknowledge(), and CNetScheduleHandler::x_WriteMessage().
◆ GetStream() ◆ GetThreadPool() ◆ GetTimeout() virtual const STimeout* IServer_ConnectionHandler::GetTimeout ( void ) inlinevirtual ◆ Init() virtual void CServer::Init ( void ) inlineprotectedvirtual ◆ IOEventToServIOEvent() ◆ IsActive() [1/2] bool CServer_Monitor::IsActive ( ) virtual ◆ IsActive() [2/2] virtual bool IServer_Monitor::IsActive ( ) pure virtual ◆ IServer_LineMessageHandler() IServer_LineMessageHandler::IServer_LineMessageHandler ( ) inlineDefinition at line 349 of file server.hpp.
◆ IServer_MessageHandler() IServer_MessageHandler::IServer_MessageHandler ( ) inlineDefinition at line 315 of file server.hpp.
◆ IsMonitorActive() bool CServer_Monitor::IsMonitorActive ( ) ◆ IsOpen() [1/3] virtual bool IServer_ConnectionBase::IsOpen ( void ) inlinevirtual ◆ IsOpen() [2/3] bool CServer_Connection::IsOpen ( void ) virtual ◆ IsOpen() [3/3] virtual bool IServer_ConnectionHandler::IsOpen ( void ) inlinevirtualReturns connection handler's perception of whether we open or not.
It is unsafe to just close underlying socket because of the race, emerging due to the fact that the socket can linger for a while.
Definition at line 247 of file server.hpp.
◆ IsReadyToProcess() [1/3] virtual bool IServer_ConnectionBase::IsReadyToProcess ( void ) inlinevirtual ◆ IsReadyToProcess() [2/3] virtual bool CServer_Connection::IsReadyToProcess ( void ) inlinevirtual ◆ IsReadyToProcess() [3/3] virtual bool IServer_ConnectionHandler::IsReadyToProcess ( void ) const inlinevirtualReturns the handler's readiness to process input data or to write some output data.
OnRead() and OnWrite() are not called unless this method return true.
Definition at line 252 of file server.hpp.
◆ m_AcceptTimeout() ◆ m_MaxThreads() ◆ m_Port() ◆ m_QueueSize() ◆ m_SpawnThreshold() ◆ m_TemporarilyStopListening() ◆ NCBI_EXCEPTION_DEFAULT() [1/2] ◆ NCBI_EXCEPTION_DEFAULT() [2/2] ◆ OnClose() virtual void IServer_ConnectionHandler::OnClose ( EClosePeer ) inlinevirtual ◆ OnError() virtual void IServer_ConnectionHandler::OnError ( const string & ) inlinevirtual ◆ OnFailure() virtual EListenAction IServer_ConnectionFactory::OnFailure ( unsigned short * ) inlinevirtual ◆ OnMessage() virtual void IServer_MessageHandler::OnMessage ( BUF buffer ) pure virtual ◆ OnOpen() virtual void IServer_ConnectionHandler::OnOpen ( void ) pure virtual ◆ OnOverflow() [1/3] ◆ OnOverflow() [2/3] ◆ OnOverflow() [3/3]Runs when there are insufficient resources to queue a connection, prior to closing it.
Provides a reason why the connection is being close, which can be reported back to the client.
Reimplemented in CNetStorageHandler, and CNetScheduleHandler.
Definition at line 288 of file server.hpp.
◆ OnRead() [1/2] void IServer_MessageHandler::OnRead ( void ) virtualThe client has just sent data.
Implements IServer_ConnectionHandler.
Definition at line 54 of file server.cpp.
References IServer_MessageHandler::CheckMessage(), conn, eActiveSocket, IServer_ConnectionHandler::eClientClose, eIO_Success, eIO_Timeout, CSocket::GetPeerAddress(), IServer_ConnectionHandler::GetSocket(), int, IO_StatusStr(), IServer_MessageHandler::m_Buffer, NStr::NumericToString(), IServer_ConnectionHandler::OnClose(), IServer_ConnectionHandler::OnError(), IServer_MessageHandler::OnMessage(), IServer_ConnectionHandler::OnTimeout(), CSocket::Read(), read_buf(), and string.
◆ OnRead() [2/2] virtual void IServer_ConnectionHandler::OnRead ( void ) pure virtual ◆ OnSocketEvent()Definition at line 552 of file server.cpp.
References IServer_ConnectionHandler::eClientClose, IServer_ConnectionHandler::eOurClose, eServIO_Alarm, eServIO_ClientClose, eServIO_Delete, eServIO_Inactivity, eServIO_Open, eServIO_OurClose, eServIO_Read, eServIO_Write, CServer_Connection::m_Handler, CServer_Connection::m_Open, and CServer_Connection::OnTimeout().
Referenced by CServer_ConnectionPool::CloseConnection(), CAcceptRequest::x_DoProcess(), and CServerConnectionRequest::x_Process().
◆ OnTimeout() [1/3] virtual void IServer_ConnectionBase::OnTimeout ( void ) inlinevirtual ◆ OnTimeout() [2/3] virtual void CServer_Connection::OnTimeout ( void ) inlinevirtual ◆ OnTimeout() [3/3] virtual void IServer_ConnectionHandler::OnTimeout ( void ) inlinevirtual ◆ OnTimer() [1/2] virtual void IServer_ConnectionBase::OnTimer ( void ) inlinevirtualDefinition at line 75 of file server_connection.hpp.
◆ OnTimer() [2/2] virtual void IServer_ConnectionHandler::OnTimer ( void ) inlinevirtualThis method is called at the moment in time specified earlier by the alarm_time parameter of the GetEventsToPollFor method [synchronous].
Definition at line 282 of file server.hpp.
◆ OnWrite() virtual void IServer_ConnectionHandler::OnWrite ( void ) pure virtual ◆ operator=() ◆ Passivate() [1/2] virtual void IServer_ConnectionBase::Passivate ( void ) inlinevirtual ◆ Passivate() [2/2] virtual void CServer_Listener::Passivate ( void ) inlinevirtual ◆ PingControlConnection() void CServer_ConnectionPool::PingControlConnection ( void ) ◆ Process() virtual void Process ( SOCK sock ) pure virtual ◆ ProcessOverflow() virtual void ProcessOverflow ( SOCK sock ) protectedvirtualRuns synchronously when request queue is full.
Implementor must take care of closing socket when done.
Definition at line 112 of file threaded_server.hpp.
References SOCK_Close().
◆ ProcessTimeout() [1/2] virtual void CServer::ProcessTimeout ( void ) inlineprotectedvirtual ◆ ProcessTimeout() [2/2] virtual void ProcessTimeout ( void ) protectedvirtual ◆ Remove() void CServer_ConnectionPool::Remove ( TConnBase * conn ) ◆ RemoveConnectionFromPool() ◆ RemoveListener() [1/2] bool CServer::RemoveListener ( unsigned short port ) ◆ RemoveListener() [2/2] bool CServer_ConnectionPool::RemoveListener ( unsigned short port )Definition at line 134 of file connection_pool.cpp.
References eListener, ERR_POST, CServer_Listener::GetPort(), ITERATE, CFastMutex::Lock(), CServer_ConnectionPool::m_Data, CServer_ConnectionPool::m_ListenerPortsToStop, CServer_ConnectionPool::m_Mutex, CServer_ConnectionPool::PingControlConnection(), IServer_ConnectionBase::type, IServer_ConnectionBase::type_lock, CFastMutex::Unlock(), and Warning().
Referenced by CServer::RemoveListener().
◆ Run() [1/2] void CServer::Run ( void )Enter the main loop.
Definition at line 793 of file server.cpp.
References CServer_ConnectionPool::Erase(), ERR_POST, CServer::Exit(), CPoolOfThreads_ForServer::KillAllThreads(), CServer::m_ConnectionPool, CServer::m_Parameters, CServer::m_ThreadPool, CServer::m_ThreadSuffix, SServer_Parameters::max_threads, s_ServerCatchExceptions, CServer::StartListening(), CServer_ConnectionPool::StopListening(), and CServer::x_DoRun().
Referenced by CGridControlThread::Main(), and CBDBEnvKeeperApp::Run().
◆ Run() [2/2] ◆ Send() [1/4] void CServer_Monitor::Send ( const char * msg, size_t length ) virtual ◆ Send() [2/4] virtual void IServer_Monitor::Send ( const char * msg, size_t length ) pure virtual ◆ Send() [3/4] ◆ Send() [4/4] virtual void IServer_Monitor::Send ( const string & str ) pure virtual ◆ SendMessage() void CServer_Monitor::SendMessage ( const char * msg, size_t length ) ◆ SendString() void CServer_Monitor::SendString ( const string & str ) ◆ Server_CheckLineMessage() int Server_CheckLineMessage ( BUF * buffer, const void * data, size_t size, bool & seen_CR ) ◆ SetAllActive() [1/2] ◆ SetAllActive() [2/2] ◆ SetConnType()Guard connection from out-of-order packet processing by pulling eActiveSocket's from poll vector Resets the expiration time as a bonus.
Definition at line 178 of file connection_pool.cpp.
References conn, eClosedSocket, eDeferredSocket, eInactiveSocket, ePreClosedSocket, ePreDeferredSocket, CServer_ConnectionPool::PingControlConnection(), type, and CServer_ConnectionPool::x_UpdateExpiration().
Referenced by CServerConnectionRequest::Cancel(), CServer::DeferConnectionProcessing(), CServerConnectionRequest::Process(), and CAcceptRequest::x_DoProcess().
◆ SetCustomThreadSuffix() void CServer::SetCustomThreadSuffix ( const string & suffix ) inlineSet custom suffix to use on all threads in the server's pool.
Value can be set only before call to Run(), any change of the value after call to Run() will be ignored.
Definition at line 161 of file server.hpp.
References CServer::m_ThreadSuffix.
◆ SetMaxConnections() void CServer_ConnectionPool::SetMaxConnections ( unsigned max_connections ) inline ◆ SetParameters() ◆ SetParams() virtual void SetParams ( ) protectedvirtual ◆ SetSocket() [1/2] void CServer_Monitor::SetSocket ( CSocket & socket )Pass open socket for monitor output.
The original socket is empty afterwards, ownership is handled by monitor. It activates the monitor.
Definition at line 53 of file server_monitor.cpp.
References eCopyTimeoutsFromSOCK, eCopyTimeoutsToSOCK, eNoOwnership, eTakeOwnership, CSocket::GetSOCK(), CServer_Monitor::m_Lock, CServer_Monitor::m_Sock, CSocket::Reset(), CServer_Monitor::SendString(), and CSocket::SetOwnership().
◆ SetSocket() [2/2] void IServer_ConnectionHandler::SetSocket ( CSocket * socket ) inline ◆ ShutdownRequested() [1/2] virtual bool CServer::ShutdownRequested ( void ) inlineprotectedvirtual ◆ ShutdownRequested() [2/2] virtual bool ShutdownRequested ( void ) protectedvirtual ◆ SServer_Parameters() SServer_Parameters::SServer_Parameters ( )Create structure with the default set of parameters.
Definition at line 878 of file server.cpp.
◆ StartListening() [1/3] void CServer::StartListening ( void ) ◆ StartListening() [2/3] void StartListening ( void )Start listening immediately, or throw an exception if it is impossible to do so.
(Does nothing if *this* object is already listening on the port.) Calling StartListening() before Run() will permit detecting port-in-use problems before the last minute. (On the other hand, clients that attempt to connect in the interim will get no response until the main loop actually starts.)
◆ StartListening() [3/3] void CServer_ConnectionPool::StartListening ( void ) ◆ StopListening() void CServer_ConnectionPool::StopListening ( void ) ◆ SubmitRequest() ◆ WakeUpPollCycle() void CServer::WakeUpPollCycle ( void ) ◆ x_DoRun() void CServer::x_DoRun ( void ) privateDefinition at line 677 of file server.cpp.
References _ASSERT, SServer_Parameters::accept_timeout, CPoolOfThreads_ForServer::AcceptRequest(), count, IServer_ConnectionBase::CreateRequest(), Critical(), eIO_Success, eIO_Timeout, ERR_POST_X, eServIO_Alarm, eServIO_Delete, eServIO_Inactivity, IServer_ConnectionBase::GetEventsToPollFor(), CServer_ConnectionPool::GetPollAndTimerVec(), SServer_Parameters::idle_timeout, CServer::Init(), NStr::IntToString(), IO_StatusStr(), IOEventToServIOEvent(), ITERATE, kDefaultTimeout, kInfiniteTimeout, CServer::m_ConnectionPool, CServer::m_Parameters, CServer::m_ThreadPool, SServer_Parameters::max_threads, NULL, CSocketAPI::Poll(), CServer::ProcessTimeout(), CTrigger::Reset(), CServer_ConnectionPool::SetAllActive(), CServer::ShutdownRequested(), CPoolOfThreads_ForServer::Spawn(), and NStr::UIntToString().
Referenced by CServer::Run().
◆ x_UpdateExpiration() void CServer_ConnectionPool::x_UpdateExpiration ( TConnBase * conn ) private ◆ ~CServer() ◆ ~CServer_Connection() CServer_Connection::~CServer_Connection ( ) virtual ◆ ~CServer_ConnectionPool() CServer_ConnectionPool::~CServer_ConnectionPool ( ) ◆ ~CServer_Monitor() CServer_Monitor::~CServer_Monitor ( ) virtual ◆ ~CThreadedServer() ◆ ~IServer_ConnectionBase() virtual IServer_ConnectionBase::~IServer_ConnectionBase ( ) inlinevirtualDefinition at line 66 of file server_connection.hpp.
◆ ~IServer_ConnectionFactory() virtual IServer_ConnectionFactory::~IServer_ConnectionFactory ( ) inlinevirtualDefinition at line 396 of file server.hpp.
◆ ~IServer_ConnectionHandler() virtual IServer_ConnectionHandler::~IServer_ConnectionHandler ( ) inlinevirtualDefinition at line 228 of file server.hpp.
◆ ~IServer_MessageHandler() virtual IServer_MessageHandler::~IServer_MessageHandler ( ) inlinevirtual ◆ ~IServer_Monitor() virtual IServer_Monitor::~IServer_Monitor ( ) inlinevirtualDefinition at line 50 of file server_monitor.hpp.
◆ accept_timeout ◆ CThreadedServerCThreadedServer - abstract class for network servers using thread pools.
This code maintains a pool of threads (initially m_InitThreads, but potentially as many as m_MaxThreads) to deal with incoming connections; each connection gets assigned to one of the worker threads, allowing the server to handle multiple requests in parallel while still checking for new requests.
You must define Process() to indicate what to do with each incoming connection; .../src/connect/test_threaded_server.cpp illustrates how you might do this.
Definition at line 77 of file threaded_server.hpp.
◆ expiration CTime IServer_ConnectionBase::expiration private ◆ idle_timeoutFor how long to keep inactive non-listening sockets open (default: 10 minutes)
Definition at line 443 of file server.hpp.
Referenced by CServer::x_DoRun().
◆ init_threads unsigned int SServer_Parameters::init_threads ◆ m_AcceptTimeout ◆ m_Buffer BUF IServer_MessageHandler::m_Buffer private ◆ m_ConnectionPoolDefinition at line 200 of file server.hpp.
Referenced by CServer::AddConnectionToPool(), CServer::AddListener(), CServer::CloseConnection(), CServer::CServer(), CServer::DeferConnectionProcessing(), CServer::GetListenerPorts(), CServer::RemoveConnectionFromPool(), CServer::RemoveListener(), CServer::Run(), CServer::SetParameters(), CServer::StartListening(), CServer::WakeUpPollCycle(), CServer::x_DoRun(), and CServer::~CServer().
◆ m_ControlTrigger CTrigger CServer_ConnectionPool::m_ControlTrigger mutableprivate ◆ m_Data TData CServer_ConnectionPool::m_Data private ◆ m_Factory ◆ m_Handler ◆ m_InitThreads unsigned int m_InitThreads protectedSettings for thread pool (which is local to Run):
Number of initial threads
Definition at line 125 of file threaded_server.hpp.
◆ m_ListenerPortsToStop vector<unsigned short> CServer_ConnectionPool::m_ListenerPortsToStop private ◆ m_ListeningStarted bool CServer_ConnectionPool::m_ListeningStarted private ◆ m_Lock ◆ m_LSock ◆ m_MaxConnections unsigned int CServer_ConnectionPool::m_MaxConnections private ◆ m_MaxThreads unsigned int m_MaxThreads protected ◆ m_Mutex CMutex CServer_ConnectionPool::m_Mutex mutableprivate ◆ m_Open bool CServer_Connection::m_Open private ◆ m_Parameters ◆ m_Port [1/2] unsigned short CServer_Listener::m_Port private ◆ m_Port [2/2] ◆ m_QueueSize ◆ m_SeenCR bool IServer_LineMessageHandler::m_SeenCR private ◆ m_Sock ◆ m_Socket CSocket* IServer_ConnectionHandler::m_Socket private ◆ m_SpawnThreshold unsigned int m_SpawnThreshold protected ◆ m_Stream ◆ m_TemporarilyStopListening bool m_TemporarilyStopListening protected ◆ m_ThreadPool ◆ m_ThreadSuffix string CServer::m_ThreadSuffix private ◆ max_connections unsigned int SServer_Parameters::max_connections ◆ max_threads unsigned int SServer_Parameters::max_threads ◆ spawn_threshold unsigned int SServer_Parameters::spawn_thresholdControls when to spawn more threads.
Definition at line 448 of file server.hpp.
◆ temporarily_stop_listening bool SServer_Parameters::temporarily_stop_listeningTemporarily close listener when queue fills?
Definition at line 438 of file server.hpp.
◆ type ◆ type_lock ◆ CAcceptRequest ◆ CNetCacheServer friend class CNetCacheServer friendDefinition at line 196 of file server.hpp.
◆ CServer_Connection ◆ CServer_ConnectionPool ◆ IServer_MessageHandlerRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4