Stun Server  Compliant with the latest RFCs including 5389, 5769, and 5780
discover the local host's own external IP address
CStunSocketThread Class Reference

#include <stunsocketthread.h>

Collaboration diagram for CStunSocketThread:

Public Member Functions

 CStunSocketThread ()
 
 ~CStunSocketThread ()
 
HRESULT Init (CStunSocket *arrayOfFourSockets, TransportAddressSet *pTSA, IStunAuth *pAuth, SocketRole rolePrimaryRecv, boost::shared_ptr< RateLimiter > &_spRateLimiter)
 
HRESULT Start ()
 
HRESULT SignalForStop (bool fPostMessages)
 
HRESULT WaitForStopAndClose ()
 

Private Member Functions

void Run ()
 
CStunSocketWaitForSocketData ()
 
HRESULT InitThreadBuffers ()
 
void UninitThreadBuffers ()
 
HRESULT ProcessRequestAndSendResponse ()
 
void ClearSocketArray ()
 

Static Private Member Functions

static void * ThreadFunction (void *pThis)
 

Private Attributes

CStunSocket_arrSendSockets
 
std::vector< CStunSocket * > _socks
 
bool _fNeedToExit
 
pthread_t _pthread
 
bool _fThreadIsValid
 
int _rotation
 
TransportAddressSet _tsa
 
CRefCountedPtr< IStunAuth_spAuth
 
CStunMessageReader _reader
 
CRefCountedBuffer _spBufferReader
 
CRefCountedBuffer _spBufferIn
 
CRefCountedBuffer _spBufferOut
 
StunMessageIn _msgIn
 
StunMessageOut _msgOut
 
boost::shared_ptr< RateLimiter_spLimiter
 

Detailed Description

Definition at line 29 of file stunsocketthread.h.

Constructor & Destructor Documentation

CStunSocketThread::CStunSocketThread ( )

Definition at line 27 of file stunsocketthread.cpp.

CStunSocketThread::~CStunSocketThread ( )

Definition at line 38 of file stunsocketthread.cpp.

Member Function Documentation

void CStunSocketThread::ClearSocketArray ( )
private

Definition at line 44 of file stunsocketthread.cpp.

HRESULT CStunSocketThread::Init ( CStunSocket arrayOfFourSockets,
TransportAddressSet pTSA,
IStunAuth pAuth,
SocketRole  rolePrimaryRecv,
boost::shared_ptr< RateLimiter > &  _spRateLimiter 
)

Definition at line 50 of file stunsocketthread.cpp.

HRESULT CStunSocketThread::InitThreadBuffers ( )
private

Definition at line 105 of file stunsocketthread.cpp.

HRESULT CStunSocketThread::ProcessRequestAndSendResponse ( )
private

Definition at line 377 of file stunsocketthread.cpp.

void CStunSocketThread::Run ( )
private

Definition at line 275 of file stunsocketthread.cpp.

HRESULT CStunSocketThread::SignalForStop ( bool  fPostMessages)

Definition at line 157 of file stunsocketthread.cpp.

HRESULT CStunSocketThread::Start ( )

Definition at line 136 of file stunsocketthread.cpp.

void * CStunSocketThread::ThreadFunction ( void *  pThis)
staticprivate

Definition at line 217 of file stunsocketthread.cpp.

void CStunSocketThread::UninitThreadBuffers ( )
private

Definition at line 124 of file stunsocketthread.cpp.

CStunSocket * CStunSocketThread::WaitForSocketData ( )
private

Definition at line 224 of file stunsocketthread.cpp.

HRESULT CStunSocketThread::WaitForStopAndClose ( )

Definition at line 196 of file stunsocketthread.cpp.

Member Data Documentation

CStunSocket* CStunSocketThread::_arrSendSockets
private

Definition at line 53 of file stunsocketthread.h.

bool CStunSocketThread::_fNeedToExit
private

Definition at line 56 of file stunsocketthread.h.

bool CStunSocketThread::_fThreadIsValid
private

Definition at line 58 of file stunsocketthread.h.

StunMessageIn CStunSocketThread::_msgIn
private

Definition at line 71 of file stunsocketthread.h.

StunMessageOut CStunSocketThread::_msgOut
private

Definition at line 72 of file stunsocketthread.h.

pthread_t CStunSocketThread::_pthread
private

Definition at line 57 of file stunsocketthread.h.

CStunMessageReader CStunSocketThread::_reader
private

Definition at line 67 of file stunsocketthread.h.

int CStunSocketThread::_rotation
private

Definition at line 60 of file stunsocketthread.h.

std::vector<CStunSocket*> CStunSocketThread::_socks
private

Definition at line 54 of file stunsocketthread.h.

CRefCountedPtr<IStunAuth> CStunSocketThread::_spAuth
private

Definition at line 64 of file stunsocketthread.h.

CRefCountedBuffer CStunSocketThread::_spBufferIn
private

Definition at line 69 of file stunsocketthread.h.

CRefCountedBuffer CStunSocketThread::_spBufferOut
private

Definition at line 70 of file stunsocketthread.h.

CRefCountedBuffer CStunSocketThread::_spBufferReader
private

Definition at line 68 of file stunsocketthread.h.

boost::shared_ptr<RateLimiter> CStunSocketThread::_spLimiter
private

Definition at line 74 of file stunsocketthread.h.

TransportAddressSet CStunSocketThread::_tsa
private

Definition at line 62 of file stunsocketthread.h.


The documentation for this class was generated from the following files: