#include <server.h>
Classes | |
class | WorkerThread |
Public Member Functions | |
GenericTCPServer () | |
~GenericTCPServer () | |
bool | Start (unsigned PortNumber, unsigned IP=0) |
Starts the server. If a server was already stopped, it cannot be restarted. | |
bool | Stop (bool WaitForWorkerThreads=true) |
Stops the server. Once it is stopped, it cannot be started any more. | |
bool | Valid () |
void | WaitForTermination () |
Protected Member Functions | |
void | WaitForWorkerThreads () |
virtual void | ConnectionHandler (TCPSocket &socket)=0 |
An overrideable connection handler that is called from a separate thread for each connection. | |
Private Attributes | |
TCPListener | m_Listener |
AtomicUInt32 | m_ActiveThreadCount |
Event | m_LastThreadDone |
BazisLib::Network::GenericTCPServer::GenericTCPServer | ( | ) |
BazisLib::Network::GenericTCPServer::~GenericTCPServer | ( | ) |
virtual void BazisLib::Network::GenericTCPServer::ConnectionHandler | ( | TCPSocket & | socket | ) | [protected, pure virtual] |
An overrideable connection handler that is called from a separate thread for each connection.
bool BazisLib::Network::GenericTCPServer::Start | ( | unsigned | PortNumber, | |
unsigned | IP = 0 | |||
) |
Starts the server. If a server was already stopped, it cannot be restarted.
bool BazisLib::Network::GenericTCPServer::Stop | ( | bool | WaitForWorkerThreads = true |
) |
Stops the server. Once it is stopped, it cannot be started any more.
bool BazisLib::Network::GenericTCPServer::Valid | ( | ) | [inline] |
void BazisLib::Network::GenericTCPServer::WaitForTermination | ( | ) | [inline] |
void BazisLib::Network::GenericTCPServer::WaitForWorkerThreads | ( | ) | [protected] |