Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions

PSTUNClient Class Reference

#include <pstun.h>

Inheritance diagram for PSTUNClient:
Inheritance graph
Collaboration diagram for PSTUNClient:
Collaboration graph

List of all members.

Public Types

enum  { DefaultPort = 3478 }
enum  NatTypes {
  UnknownNat, OpenNat, ConeNat, RestrictedNat,
  PortRestrictedNat, SymmetricNat, SymmetricFirewall, BlockedNat,
  PartialBlockedNat, NumNatTypes
enum  RTPSupportTypes { RTPOK, RTPUnknown, RTPUnsupported, RTPIfSendMedia }

Public Member Functions

BOOL CreateSocket (PUDPSocket *&socket)
virtual BOOL CreateSocketPair (PUDPSocket *&socket1, PUDPSocket *&socket2)
virtual BOOL GetExternalAddress (PIPSocket::Address &externalAddress, const PTimeInterval &maxAge=1000)
NatTypes GetNatType (BOOL force=FALSE)
PString GetNatTypeName (BOOL force=FALSE)
PINDEX GetRetries () const
PString GetServer () const
PINDEX GetSocketsForPairing () const
const PTimeInterval GetTimeout () const
virtual BOOL IsAvailable ()
RTPSupportTypes IsSupportingRTP (BOOL force=FALSE)
 PSTUNClient (const PIPSocket::Address &serverAddress, WORD serverPort=DefaultPort, WORD portBase=0, WORD portMax=0, WORD portPairBase=0, WORD portPairMax=0)
 PSTUNClient (const PString &server, WORD portBase=0, WORD portMax=0, WORD portPairBase=0, WORD portPairMax=0)
void SetRetries (PINDEX retries)
BOOL SetServer (const PString &server)
BOOL SetServer (const PIPSocket::Address &serverAddress, WORD serverPort=0)
void SetSocketsForPairing (PINDEX numSockets)
void SetTimeout (const PTimeInterval &timeout)
General Functions
virtual void SetPortRanges (WORD portBase, WORD portMax=0, WORD portPairBase=0, WORD portPairMax=0)
Miscellaneous functions
virtual PObjectClone () const
virtual PINDEX HashFunction () const

Static Public Member Functions

static PString GetNatTypeString (NatTypes type)

Protected Member Functions

bool OpenSocket (PUDPSocket &socket, PortInfo &portInfo) const

Protected Attributes

PIPSocket::Address cachedExternalAddress
NatTypes natType
PINDEX numSocketsForPairing
struct PNatMethod::PortInfo pairedPortInfo
PINDEX pollRetries
PTimeInterval replyTimeout
PIPSocket::Address serverAddress
WORD serverPort
struct PNatMethod::PortInfo singlePortInfo
PTime timeAddressObtained

Private Member Functions


Comparison functions

enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }
virtual Comparison Compare (const PObject &obj) const
virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
bool operator== (const PObject &obj) const
bool operator!= (const PObject &obj) const
bool operator< (const PObject &obj) const
bool operator> (const PObject &obj) const
bool operator<= (const PObject &obj) const
bool operator>= (const PObject &obj) const

Run Time Type functions

virtual const char * GetClass (unsigned=0) const
BOOL IsClass (const char *cls) const
virtual BOOL InternalIsDescendant (const char *clsName) const
static const char * Class ()

I/O functions

virtual void PrintOn (ostream &strm) const
virtual void ReadFrom (istream &strm)
ostream & operator<< (ostream &strm, const PObject &obj)
istream & operator>> (istream &strm, PObject &obj)

Detailed Description

STUN client.

Definition at line 108 of file pstun.h.

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

Generated by  Doxygen 1.6.0   Back to index