NCBI C++ ToolKit
|
Search Toolkit Book for CWNCTConnectionHandler
#include "grid_control_thread.hpp"
(Private to src/connect/services
.)
Public Member Functions | |
CWNCTConnectionHandler (CWorkerNodeControlServer &server) | |
virtual | ~CWNCTConnectionHandler () |
virtual void | OnOpen (void) |
Runs in response to an external event [asynchronous]. More... | |
virtual void | OnMessage (BUF buffer) |
virtual void | OnWrite () |
The client is ready to receive data. More... | |
![]() | |
IServer_LineMessageHandler () | |
virtual int | CheckMessage (BUF *buffer, const void *data, size_t size) |
![]() | |
IServer_MessageHandler () | |
virtual | ~IServer_MessageHandler () |
virtual void | OnRead (void) |
The client has just sent data. More... | |
![]() | |
virtual | ~IServer_ConnectionHandler () |
virtual EIO_Event | GetEventsToPollFor (const CTime **) const |
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. More... | |
virtual const STimeout * | GetTimeout (void) |
Returns the timeout for this connection. More... | |
virtual bool | IsOpen (void) |
Returns connection handler's perception of whether we open or not. More... | |
virtual bool | IsReadyToProcess (void) const |
Returns the handler's readiness to process input data or to write some output data. More... | |
virtual void | OnClose (EClosePeer) |
The connection has closed (with information on type of closing) More... | |
virtual void | OnTimeout (void) |
Runs when a client has been idle for too long, prior to closing the connection [synchronous]. More... | |
virtual void | OnTimer (void) |
This method is called at the moment in time specified earlier by the alarm_time parameter of the GetEventsToPollFor method [synchronous]. More... | |
virtual void | OnOverflow (EOverflowReason) |
Runs when there are insufficient resources to queue a connection, prior to closing it. More... | |
virtual void | OnError (const string &) |
Runs when a socket error is detected. More... | |
CSocket & | GetSocket (void) |
Get underlying socket. More... | |
void | SetSocket (CSocket *socket) |
Private Member Functions | |
void | x_ProcessAuth (BUF buffer) |
void | x_ProcessQueue (BUF buffer) |
void | x_ProcessRequest (BUF buffer) |
CWNCTConnectionHandler (const CWNCTConnectionHandler &) | |
CWNCTConnectionHandler & | operator= (const CWNCTConnectionHandler &) |
Private Attributes | |
CWorkerNodeControlServer & | m_Server |
string | m_Auth |
string | m_Queue |
void(CWNCTConnectionHandler::* | m_ProcessMessage )(BUF buffer) |
Additional Inherited Members | |
![]() | |
enum | EClosePeer { eOurClose , eClientClose } |
Type of connection closing. More... | |
Definition at line 99 of file grid_control_thread.hpp.
CWNCTConnectionHandler::CWNCTConnectionHandler | ( | CWorkerNodeControlServer & | server | ) |
Definition at line 452 of file grid_control_thread.cpp.
|
virtual |
Definition at line 456 of file grid_control_thread.cpp.
|
private |
|
virtual |
Implements IServer_MessageHandler.
Definition at line 473 of file grid_control_thread.cpp.
References IServer_ConnectionHandler::GetSocket(), m_ProcessMessage, and s_HandleError().
|
virtual |
Runs in response to an external event [asynchronous].
You can get socket by calling GetSocket(), if you close the socket this object will be destroyed. Individual events are: A client has just established this connection.
Implements IServer_ConnectionHandler.
Definition at line 459 of file grid_control_thread.cpp.
References CSocket::DisableOSSendDelay(), IServer_ConnectionHandler::GetSocket(), m_ProcessMessage, and x_ProcessAuth().
|
inlinevirtual |
The client is ready to receive data.
Implements IServer_ConnectionHandler.
Definition at line 109 of file grid_control_thread.hpp.
|
private |
|
private |
Definition at line 484 of file grid_control_thread.cpp.
References buffer, m_Auth, m_ProcessMessage, s_ReadStrFromBUF(), and x_ProcessQueue().
Referenced by OnOpen().
|
private |
Definition at line 489 of file grid_control_thread.cpp.
References buffer, m_ProcessMessage, m_Queue, s_ReadStrFromBUF(), and x_ProcessRequest().
Referenced by x_ProcessAuth().
|
private |
Definition at line 494 of file grid_control_thread.cpp.
References buffer, CSocket::GetPeerAddress(), IServer_ConnectionHandler::GetSocket(), m_Auth, m_Queue, m_Server, CWorkerNodeControlServer::MakeProcessor(), s_ReadStrFromBUF(), and CSocket::Write().
Referenced by x_ProcessQueue().
|
private |
Definition at line 114 of file grid_control_thread.hpp.
Referenced by x_ProcessAuth(), and x_ProcessRequest().
Definition at line 117 of file grid_control_thread.hpp.
Referenced by OnMessage(), OnOpen(), x_ProcessAuth(), and x_ProcessQueue().
|
private |
Definition at line 115 of file grid_control_thread.hpp.
Referenced by x_ProcessQueue(), and x_ProcessRequest().
|
private |
Definition at line 113 of file grid_control_thread.hpp.
Referenced by x_ProcessRequest().