NCBI C++ ToolKit
Public Member Functions | Private Attributes | List of all members
CServer_Connection Class Reference

Search Toolkit Book for CServer_Connection

#include <connect/impl/server_connection.hpp>

+ Inheritance diagram for CServer_Connection:
+ Collaboration diagram for CServer_Connection:

Public Member Functions

 CServer_Connection (IServer_ConnectionHandler *handler)
 
virtual EIO_Event GetEventsToPollFor (const CTime **alarm_time) const
 
virtual CStdRequestCreateRequest (EServIO_Event event, CServer_ConnectionPool &connPool, const STimeout *timeout)
 
virtual void OnTimeout (void)
 
virtual void OnOverflow (EOverflowReason reason)
 
virtual bool IsReadyToProcess (void)
 
virtual bool IsOpen (void)
 
void OnSocketEvent (EServIO_Event event)
 
virtual ~CServer_Connection ()
 
- Public Member Functions inherited from IServer_ConnectionBase
virtual ~IServer_ConnectionBase ()
 
virtual void OnTimer (void)
 
virtual void Activate (void)
 
virtual void Passivate (void)
 
- Public Member Functions inherited from CSocket
 CSocket (void)
 CSocket:: More...
 
 CSocket (const string &host, unsigned short port, const STimeout *timeout=kInfiniteTimeout, TSOCK_Flags flags=fSOCK_LogDefault)
 Create a client-side socket connected to "host:port". More...
 
 CSocket (const string &hostport, const STimeout *timeout=kInfiniteTimeout, TSOCK_Flags flags=fSOCK_LogDefault)
 Create a client-side socket connected to "host:port". More...
 
 CSocket (unsigned int host, unsigned short port, const STimeout *timeout=kInfiniteTimeout, TSOCK_Flags flags=fSOCK_LogDefault)
 Variant of the above, which takes host as a binary value in network byte order. More...
 
virtual ~CSocket (void)
 Call Close(), then self-destruct. More...
 
EIO_Status GetStatus (EIO_Event direction) const
 Return status of *last* I/O operation without making any actual I/O. More...
 
EIO_Status Connect (const string &host, unsigned short port, const STimeout *timeout=kDefaultTimeout, TSOCK_Flags flags=fSOCK_LogDefault)
 Connect to "host:port". More...
 
EIO_Status Connect (const string &hostport, const STimeout *timeout=kDefaultTimeout, TSOCK_Flags flags=fSOCK_LogDefault)
 Connect to "host:port". More...
 
EIO_Status Reconnect (const STimeout *timeout=kDefaultTimeout)
 Reconnect to the same address. More...
 
EIO_Status Shutdown (EIO_Event how)
 Shutdown socket I/O in the specified direction. More...
 
EIO_Status Close (void)
 Close socket. More...
 
EIO_Status Wait (EIO_Event event, const STimeout *timeout)
 Wait for I/O availability in the socket. More...
 
EIO_Status SetTimeout (EIO_Event event, const STimeout *timeout)
 Set timeout for I/O in the specified direction. More...
 
const STimeoutGetTimeout (EIO_Event event) const
 Get timeout for I/O in the specified direction. More...
 
EIO_Status Read (void *buf, size_t size, size_t *n_read=0, EIO_ReadMethod how=eIO_ReadPlain)
 Read from socket. More...
 
EIO_Status ReadLine (string &str)
 Read a line from socket (up to CR-LF, LF, or null character, discarding any of the EOLs). More...
 
EIO_Status ReadLine (char *buf, size_t size, size_t *n_read=0)
 Read a line from socket (up to CR-LF, LF, or null character, discarding any of the EOLs). More...
 
EIO_Status Pushback (const void *buf, size_t size)
 Push back data to socket (to be read out first). More...
 
EIO_Status Write (const void *buf, size_t size, size_t *n_written=0, EIO_WriteMethod how=eIO_WritePersist)
 Write to socket. More...
 
EIO_Status Abort (void)
 Abort socket connection. More...
 
unsigned short GetLocalPort (ENH_ByteOrder byte_order, bool trueport=false) const
 Get socket local port number. More...
 
unsigned short GetRemotePort (ENH_ByteOrder byte_order) const
 Get socket remote port number. More...
 
void GetPeerAddress (unsigned int *host, unsigned short *port, ENH_ByteOrder byte_order) const
 Get peer address. More...
 
string GetPeerAddress (ESOCK_AddressFormat format=eSAF_Full) const
 Get peer address as a text string. More...
 
virtual EIO_Status GetOSHandle (void *handle_buf, size_t handle_size, EOwnership ownership=eNoOwnership) const
 Access to the system-specific socket handle. More...
 
ESwitch SetReadOnWrite (ESwitch read_on_write=eOn)
 
ESwitch SetInterruptOnSignal (ESwitch interrupt=eOn)
 
void SetReuseAddress (ESwitch reuse=eOff)
 
void SetCork (bool on_off=true)
 
void DisableOSSendDelay (bool on_off=true)
 
ESwitch SetDataLogging (ESwitch log=eOn)
 
bool IsDatagram (void) const
 
bool IsClientSide (void) const
 
bool IsServerSide (void) const
 
bool IsUNIX (void) const
 
bool IsSecure (void) const
 
TNCBI_BigCount GetPosition (EIO_Event direction) const
 Positions and stats (direction is either eIO_Read or eIO_Write). More...
 
TNCBI_BigCount GetCount (EIO_Event direction) const
 
TNCBI_BigCount GetTotalCount (EIO_Event direction) const
 
void Reset (SOCK sock, EOwnership if_to_own, ECopyTimeout whence)
 Close the current underlying "SOCK" (if any, and if owned), and from now on use "sock" as the underlying "SOCK" instead. More...
 
EOwnership SetOwnership (EOwnership if_to_own)
 Specify if this "CSocket" is to own the underlying "SOCK". More...
 
SOCK GetSOCK (void) const
 Access to the underlying "SOCK". More...
 
bool IsEmpty (void) const
 
virtual POLLABLE GetPOLLABLE (void) const
 
- Public Member Functions inherited from CPollable
virtual ~CPollable ()
 

Private Attributes

unique_ptr< IServer_ConnectionHandlerm_Handler
 
bool m_Open
 

Additional Inherited Members

- Protected Member Functions inherited from CPollable
 CPollable (void)
 
- Protected Attributes inherited from CSocket
SOCK m_Socket
 
EOwnership m_IsOwned
 Timeouts. More...
 
STimeouto_timeout
 eIO_Open More...
 
STimeoutr_timeout
 eIO_Read More...
 
STimeoutw_timeout
 eIO_Write More...
 
STimeoutc_timeout
 eIO_Close More...
 
STimeout oo_timeout
 storage for o_timeout More...
 
STimeout rr_timeout
 storage for r_timeout More...
 
STimeout ww_timeout
 storage for w_timeout More...
 
STimeout cc_timeout
 storage for c_timeout More...
 

Detailed Description

Definition at line 89 of file server_connection.hpp.


The documentation for this class was generated from the following files:
Modified on Wed Apr 17 13:08:47 2024 by modify_doxy.py rev. 669887