C++ common classes
General purpose classes for use across projects (Apache license)
|
Server socket listens to establish a connection. More...
#include <CServerSocket.h>
Public Member Functions | |
CServerSocket () | |
constructor | |
virtual | ~CServerSocket () |
BOOL | Listen (int nConnectionBacklog=5) |
methods | |
void | ShutdownAll () |
time_t | GetTimeStarted () |
void | WaitForExit () |
Wait for listening thread to exit. | |
Protected Member Functions | |
virtual void | CleanupArray (BOOL bTerminateAll=FALSE) |
Clean up array. | |
virtual BOOL | Accept () |
Accept connections. | |
virtual CConnectionSocket * | AllocateSocketClass (struct sockaddr *pAddr)=0 |
Static Protected Member Functions | |
static unsigned | AcceptConnection (void *pVoid) |
Listening thread. | |
Protected Attributes | |
vector< void * > | cSocketArray |
data member | |
XPLAT_HANDLE | hThread |
time_t | tStarted |
CXPlatCriticalSection | cCritSocketArray |
Server socket listens to establish a connection.
TCP socket server class
Definition at line 27 of file CServerSocket.h.
constructor
Definition at line 29 of file CServerSocket.cpp.
CServerSocket::~CServerSocket | ( | ) | [virtual] |
Definition at line 35 of file CServerSocket.cpp.
BOOL CServerSocket::Accept | ( | ) | [protected, virtual] |
Accept connections.
Definition at line 99 of file CServerSocket.cpp.
unsigned CServerSocket::AcceptConnection | ( | void * | pVoid | ) | [static, protected] |
Listening thread.
Definition at line 280 of file CServerSocket.cpp.
virtual CConnectionSocket* CServerSocket::AllocateSocketClass | ( | struct sockaddr * | pAddr | ) | [protected, pure virtual] |
Pure virtual functions allocate and dallocate a derivative of CConnectionSocket Redefine in derived class
void CServerSocket::CleanupArray | ( | BOOL | bTerminateAll = FALSE | ) | [protected, virtual] |
Clean up array.
Definition at line 217 of file CServerSocket.cpp.
time_t CServerSocket::GetTimeStarted | ( | ) |
Definition at line 292 of file CServerSocket.cpp.
BOOL CServerSocket::Listen | ( | int | nConnectionBacklog = 5 | ) |
methods
Definition at line 44 of file CServerSocket.cpp.
Definition at line 261 of file CServerSocket.cpp.
Wait for listening thread to exit.
Definition at line 300 of file CServerSocket.cpp.
CXPlatCriticalSection CServerSocket::cCritSocketArray [protected] |
Definition at line 62 of file CServerSocket.h.
vector<void *> CServerSocket::cSocketArray [protected] |
data member
Array of CConnectionSocket objects created
Definition at line 59 of file CServerSocket.h.
XPLAT_HANDLE CServerSocket::hThread [protected] |
Definition at line 60 of file CServerSocket.h.
time_t CServerSocket::tStarted [protected] |
Definition at line 61 of file CServerSocket.h.