#include <CServerConnectionEvent.h>
Inheritance diagram for CServerConnectionEvent:
Public Member Functions | |
CServerConnectionEvent (CSocket &sock) | |
CServerConnectionEvent (const char *pName, CSocket &sock) | |
CServerConnectionEvent (const STD(string)&rName, CSocket &sock) | |
CServerConnectionEvent (const STD(string)&rServiceName) | |
CServerConnectionEvent (const char *pName, const STD(string)&rServiceName) | |
CServerConnectionEvent (const STD(string)&rName, const STD(string)&rServiceName) | |
CServerConnectionEvent (int nFd) | |
CServerConnectionEvent (const char *pName, int nFd) | |
CServerConnectionEvent (const STD(string)&rName, int nFd) | |
~CServerConnectionEvent () | |
CSocket * | getSocket () |
bool | isDynamicSocket () const |
virtual void | OnConnection (CSocket *pPeer) |
virtual void | OnReadable (STD(istream)&rStream) |
virtual | STD (string) DescribeSelf() |
Protected Member Functions | |
void | setSocket (CSocket *pSocket) |
void | setDynamic (bool fDyn) |
void | ConfigureSocket (const STD(string)&rSvcName) |
void | ConfigureSocket (int nPort) |
int | Protocol () |
Private Member Functions | |
CServerConnectionEvent (const CServerConnectionEvent &rhs) | |
CServerConnectionEvent & | operator= (const CServerConnectionEvent &rhs) |
int | operator== (const CServerConnectionEvent &rhs) |
Private Attributes | |
CSocket * | m_pService |
Server listener socket. | |
bool | m_fDeleteSocket |
true if destructor delete socket. |
|
Construct an anonymous connection listener from an existing socket object. In this case, it will not be necessary for the destructor to eliminate the socket.
Definition at line 312 of file CServerConnectionEvent.cpp. |
|
Construct a named connection listener from and existing socket object.
Definition at line 324 of file CServerConnectionEvent.cpp. |
|
|
|
|
|
|
|
|
|
Construct an anonymous Connection listener given a file id which represents a bound and listening socket.
Definition at line 395 of file CServerConnectionEvent.cpp. |
|
Construct a named connection listener given a file id which represents a bound and listening socket.
Definition at line 408 of file CServerConnectionEvent.cpp. |
|
|
|
Destructor... if m_fDelete socket is true, then the socket is deleted. otherwise just closed. Definition at line 432 of file CServerConnectionEvent.cpp. References m_pService, and CSocket::Shutdown(). |
|
|
|
Utility function to configure a socket. The port id is used to bind the socket and set it into listen mode.
Definition at line 520 of file CServerConnectionEvent.cpp. References ConfigureSocket(). |
|
Referenced by ConfigureSocket(). |
|
Definition at line 369 of file CServerConnectionEvent.h. |
|
Definition at line 373 of file CServerConnectionEvent.h. |
|
This member function is called whenever a connection is available. The default implementation rejects the connection and destroys the connection object. It's assumed that the user of this class will subclass it and override this member with code to generate an object to manage the connection. How this is done depends on the needs of the application. One typical way to do this would be to create a CServerInstance derived object and enable it. This would start up a server instance in a separate thread, to handle requests in a application synchronized manner.
Definition at line 452 of file CServerConnectionEvent.cpp. References CSocket::Shutdown(). |
|
|
|
|
|
|
|
Determine the correct protocol id for a socket(2) call. We only support tcp as the protocol. This function encapsulates the call to getprotobyname(3), and the decode of the arguments. getprotobyname(3) is assumed to be non-reentrant/non-recursive and therefore the call to it is serialized to the application. Failures are not considered possible, so are asserted against, since the only acceptable protocol is "TCP".
Definition at line 542 of file CServerConnectionEvent.cpp. References CApplicationSerializer::getInstance(), CThreadRecursiveMutex::Lock(), and CThreadRecursiveMutex::UnLock(). |
|
Definition at line 382 of file CServerConnectionEvent.h. References m_fDeleteSocket. |
|
Definition at line 379 of file CServerConnectionEvent.h. References m_pService. |
|
The name of the object Reimplemented from CFileEvent. |
|
true if destructor delete socket.
Definition at line 333 of file CServerConnectionEvent.h. Referenced by setDynamic(). |
|
Server listener socket.
Definition at line 332 of file CServerConnectionEvent.h. Referenced by setSocket(), and ~CServerConnectionEvent(). |