Stun Server
Compliant with the latest RFCs including 5389, 5769, and 5780
discover the local host's own external IP address
|
#include <tcpserver.h>
Public Member Functions | |
CTCPStunThread () | |
~CTCPStunThread () | |
HRESULT | Init (const TransportAddressSet &tsaListen, const TransportAddressSet &tsaHandler, IStunAuth *pAuth, int maxConnections, boost::shared_ptr< RateLimiter > &spLimiter) |
HRESULT | Start () |
HRESULT | Stop () |
Private Types | |
typedef FastHashDynamic< int, StunConnection * > | StunThreadConnectionMap |
Private Member Functions | |
HRESULT | CreatePipes () |
HRESULT | NotifyThreadViaPipe () |
void | ClosePipes () |
HRESULT | SetListenSocketsOnEpoll (bool fEnable) |
HRESULT | CreateListenSockets () |
void | CloseListenSockets () |
CStunSocket * | GetListenSocket (int sock) |
void | Run () |
void | Reset () |
StunConnection * | AcceptConnection (CStunSocket *pListenSocket) |
void | ProcessConnectionEvent (int sock, uint32_t eventflags) |
HRESULT | ReceiveBytesForConnection (StunConnection *pConn) |
HRESULT | WriteBytesForConnection (StunConnection *pConn) |
void | CloseAllConnections (StunThreadConnectionMap *pConnMap) |
void | SweepDeadConnections () |
void | ThreadCleanup () |
int | GetTimeoutSeconds () |
bool | IsConnectionCountAtMax () |
void | CloseConnection (StunConnection *pConn) |
bool | RateCheck (const CSocketAddress &addr) |
Static Private Member Functions | |
static void * | ThreadFunction (void *pThis) |
Private Attributes | |
int | _pipe [2] |
CRefCountedPtr< IPolling > | _spPolling |
bool | _fListenSocketsOnEpoll |
boost::shared_ptr< RateLimiter > | _spLimiter |
TransportAddressSet | _tsaListen |
CStunSocket | _socketListenArray [4] |
int | _socketTable [4] |
int | _countSocks |
bool | _fNeedToExit |
CRefCountedPtr< IStunAuth > | _spAuth |
SocketRole | _role |
TransportAddressSet | _tsa |
int | _maxConnections |
pthread_t | _pthread |
bool | _fThreadIsValid |
CConnectionPool | _connectionpool |
StunThreadConnectionMap | _hashConnections1 |
StunThreadConnectionMap | _hashConnections2 |
StunThreadConnectionMap * | _pNewConnList |
StunThreadConnectionMap * | _pOldConnList |
time_t | _timeLastSweep |
Static Private Attributes | |
static const int | c_sweepTimeoutSeconds = 60 |
Definition at line 32 of file tcpserver.h.
|
private |
Definition at line 82 of file tcpserver.h.
CTCPStunThread::CTCPStunThread | ( | ) |
Definition at line 40 of file tcpserver.cpp.
CTCPStunThread::~CTCPStunThread | ( | ) |
Definition at line 86 of file tcpserver.cpp.
|
private |
Definition at line 484 of file tcpserver.cpp.
|
private |
Definition at line 743 of file tcpserver.cpp.
|
private |
Definition at line 713 of file tcpserver.cpp.
|
private |
Definition at line 200 of file tcpserver.cpp.
|
private |
Definition at line 109 of file tcpserver.cpp.
|
private |
Definition at line 171 of file tcpserver.cpp.
|
private |
Definition at line 93 of file tcpserver.cpp.
|
private |
Definition at line 211 of file tcpserver.cpp.
|
private |
Definition at line 347 of file tcpserver.cpp.
HRESULT CTCPStunThread::Init | ( | const TransportAddressSet & | tsaListen, |
const TransportAddressSet & | tsaHandler, | ||
IStunAuth * | pAuth, | ||
int | maxConnections, | ||
boost::shared_ptr< RateLimiter > & | spLimiter | ||
) |
Definition at line 230 of file tcpserver.cpp.
|
private |
Definition at line 353 of file tcpserver.cpp.
|
private |
Definition at line 124 of file tcpserver.cpp.
|
private |
Definition at line 430 of file tcpserver.cpp.
|
private |
Definition at line 463 of file tcpserver.cpp.
|
private |
Definition at line 555 of file tcpserver.cpp.
|
private |
Definition at line 47 of file tcpserver.cpp.
|
private |
Definition at line 362 of file tcpserver.cpp.
|
private |
Definition at line 138 of file tcpserver.cpp.
HRESULT CTCPStunThread::Start | ( | ) |
Definition at line 298 of file tcpserver.cpp.
HRESULT CTCPStunThread::Stop | ( | ) |
Definition at line 318 of file tcpserver.cpp.
|
private |
Definition at line 753 of file tcpserver.cpp.
|
private |
Definition at line 779 of file tcpserver.cpp.
|
staticprivate |
Definition at line 341 of file tcpserver.cpp.
|
private |
Definition at line 645 of file tcpserver.cpp.
|
private |
Definition at line 69 of file tcpserver.h.
|
private |
Definition at line 53 of file tcpserver.h.
|
private |
Definition at line 43 of file tcpserver.h.
|
private |
Definition at line 59 of file tcpserver.h.
|
private |
Definition at line 67 of file tcpserver.h.
|
private |
Definition at line 84 of file tcpserver.h.
|
private |
Definition at line 85 of file tcpserver.h.
|
private |
Definition at line 64 of file tcpserver.h.
|
private |
Definition at line 37 of file tcpserver.h.
|
private |
Definition at line 87 of file tcpserver.h.
|
private |
Definition at line 88 of file tcpserver.h.
|
private |
Definition at line 66 of file tcpserver.h.
|
private |
Definition at line 61 of file tcpserver.h.
|
private |
Definition at line 51 of file tcpserver.h.
|
private |
Definition at line 52 of file tcpserver.h.
|
private |
Definition at line 60 of file tcpserver.h.
|
private |
Definition at line 45 of file tcpserver.h.
|
private |
Definition at line 42 of file tcpserver.h.
|
private |
Definition at line 89 of file tcpserver.h.
|
private |
Definition at line 63 of file tcpserver.h.
|
private |
Definition at line 50 of file tcpserver.h.
|
staticprivate |
Definition at line 34 of file tcpserver.h.