EvEmu
0.8.4
11 September 2021
|
Connection-type-dependent version of TCP server. More...
#include "TCPServer.h"
Public Member Functions | |
~TCPServer () | |
Deletes all stored connections. More... | |
X * | PopConnection () |
Pops connection from queue. More... | |
![]() | |
BaseTCPServer () | |
Creates empty TCP server. More... | |
virtual | ~BaseTCPServer () |
Cleans server up. More... | |
uint16 | GetPort () const |
bool | IsOpen () const |
bool | Open (uint16 port, char *errbuf=0) |
Start listening on specified port. More... | |
void | Close () |
Stops started listening. More... | |
Protected Member Functions | |
void | AddConnection (X *con) |
Adds connection to the queue. More... | |
![]() | |
void | StartLoop () |
Starts worker thread. More... | |
void | WaitLoop () |
Waits for worker thread to terminate. More... | |
virtual bool | Process () |
Does periodical stuff to keep the server alive. More... | |
void | ListenNewConnections () |
Accepts all new connections. More... | |
virtual void | CreateNewConnection (Socket *sock, uint32 rIP, uint16 rPort)=0 |
Processes new connection. More... | |
void | TCPServerLoop () |
Loop for worker threads. More... | |
Protected Attributes | |
Mutex | mMQueue |
std::queue< X * > | mQueue |
![]() | |
Mutex | mMSock |
Socket * | mSock |
uint16 | mPort |
Mutex | mMLoopRunning |
Additional Inherited Members | |
![]() | |
static void * | TCPServerLoop (void *arg) |
Loop for worker threads. More... | |
Connection-type-dependent version of TCP server.
Definition at line 136 of file TCPServer.h.
|
inlineprotected |
Adds connection to the queue.
[in] | con | Connection to be added to the queue. |
Definition at line 176 of file TCPServer.h.
|
inline |
Pops connection from queue.
Definition at line 156 of file TCPServer.h.
Referenced by main(), and TCPServer< EVETCPConnection >::~TCPServer().
Mutex to protect connection queue.
Definition at line 184 of file TCPServer.h.
Referenced by TCPServer< EVETCPConnection >::AddConnection(), TCPServer< EVETCPConnection >::PopConnection(), and TCPServer< EVETCPConnection >::~TCPServer().
|
protected |
Connection queue.
Definition at line 186 of file TCPServer.h.
Referenced by TCPServer< EVETCPConnection >::AddConnection(), and TCPServer< EVETCPConnection >::PopConnection().