Yate
UDPSession Class Reference

RTP or UDPTL session. More...

#include <yatertp.h>

Inheritance diagram for UDPSession:
RTPProcessor GenObject RTPDebug RTPSession UDPTLSession

Public Member Functions

virtual ~UDPSession ()
 
virtual RTPTransportcreateTransport ()
 
bool initTransport ()
 
bool initGroup (int msec=0, Thread::Priority prio=Thread::Normal, const String &affinity=String::empty())
 
bool remoteAddr (SocketAddr &addr, bool sniff=false)
 
bool setBuffer (int bufLen=4096)
 
bool setTOS (int tos)
 
SocketrtpSock ()
 
bool drillHole ()
 
void setTimeout (int interval)
 
RTPTransporttransport () const
 
virtual void transport (RTPTransport *trans)
 
- Public Member Functions inherited from RTPProcessor
 RTPProcessor (DebugEnabler *dbg=0, const char *traceId=0)
 
virtual ~RTPProcessor ()
 
RTPGroupgroup () const
 
virtual void rtpData (const void *data, int len)
 
virtual void rtcpData (const void *data, int len)
 
virtual void getStats (String &stats) const
 
virtual void incWrongSrc ()
 
unsigned int wrongSrc ()
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
virtual bool alive () const
 
virtual void destruct ()
 
virtual const StringtoString () const
 
virtual const StringtraceId () const
 
virtual void * getObject (const String &name) const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 
- Public Member Functions inherited from RTPDebug
 RTPDebug (DebugEnabler *dbg, const char *traceId)
 
 RTPDebug (RTPSession *session)
 
DebugEnablerdbg () const
 
const StringdbgTraceId () const
 

Protected Member Functions

 UDPSession (DebugEnabler *dbg=0, const char *traceId=0)
 
virtual void timeout (bool initial)
 
- Protected Member Functions inherited from RTPProcessor
void group (RTPGroup *newgrp)
 
virtual void timerTick (const Time &when)=0
 
- Protected Member Functions inherited from RTPDebug
void setDebug (DebugEnabler *dbg, const char *traceId)
 

Protected Attributes

RTPTransportm_transport
 
u_int64_t m_timeoutTime
 
u_int64_t m_timeoutInterval
 
- Protected Attributes inherited from RTPProcessor
unsigned int m_wrongSrc
 
- Protected Attributes inherited from RTPDebug
DebugEnablerm_dbg
 
String m_traceId
 

Additional Inherited Members

- Static Public Member Functions inherited from GenObject
static void * getObject (const String &name, const GenObject *obj)
 
static bool getObjCounting ()
 
static void setObjCounting (bool enable)
 
static NamedCountergetObjCounter (const String &name, bool create=true)
 
static ObjListgetObjCounters ()
 

Detailed Description

RTP or UDPTL session.

A base class for RTP, SRTP or UDPTL sessions

Constructor & Destructor Documentation

◆ ~UDPSession()

virtual ~UDPSession ( )
virtual

Destructor - cleans up any remaining resources

◆ UDPSession()

UDPSession ( DebugEnabler * dbg = 0,
const char * traceId = 0 )
protected

Default constructor

Parameters
dbgSession DebugEnabler
traceIdSession trace ID

References RTPDebug::dbg(), and GenObject::traceId().

Member Function Documentation

◆ createTransport()

virtual RTPTransport * createTransport ( )
virtual

Create a new RTP or UDP transport for this session. Override this method to create objects derived from RTPTransport.

Returns
Pointer to the new transport or NULL on failure

Reimplemented in UDPTLSession.

◆ drillHole()

bool drillHole ( )
inline

Drill a hole in a firewall or NAT for the RTP and RTCP sockets

Returns
True if at least a packet was sent for the RTP socket

◆ initGroup()

bool initGroup ( int msec = 0,
Thread::Priority prio = Thread::Normal,
const String & affinity = String::empty() )

Initialize the RTP session, attach a group if none is present

Parameters
msecMinimum time to sleep in group loop in milliseconds
prioThread priority to run the new group
affinityComma-separated list of CPUs and/or CPU range on which the thread should run on
Returns
True if initialized, false on some failure

References String::empty().

◆ initTransport()

bool initTransport ( )

Initialize the RTP session, attach a transport if there is none

Returns
True if initialized, false on some failure

◆ remoteAddr()

bool remoteAddr ( SocketAddr & addr,
bool sniff = false )
inline

Set the remote network address of the RTP transport of this session

Parameters
addrNew remote RTP transport address
sniffAutomatically adjust the address from the first incoming packet
Returns
True if address set, false if a failure occured

◆ rtpSock()

Socket * rtpSock ( )
inline

Get the main transport socket used by this session

Returns
Pointer to the RTP or UDPTL socket, NULL if no transport exists

◆ setBuffer()

bool setBuffer ( int bufLen = 4096)
inline

Set the size of the operating system's buffers for the RTP and RTCP transport sockets

Parameters
bufLenRequested length of the buffer
Returns
True if the buffer length was set

◆ setTimeout()

void setTimeout ( int interval)

Set the interval until receiver timeout is detected

Parameters
intervalMilliseconds until receiver times out, zero to disable

◆ setTOS()

bool setTOS ( int tos)
inline

Set the Type Of Service for the RTP transport socket

Parameters
tosType Of Service bits to set
Returns
True if operation was successfull, false if an error occured

◆ timeout()

virtual void timeout ( bool initial)
protectedvirtual

Method called when the receiver timed out

Parameters
initialTrue if no packet was ever received in this session

◆ transport() [1/2]

RTPTransport * transport ( ) const
inline

Get the RTP/RTCP transport of data handled by this session.

Returns
A pointer to the RTPTransport of this session

◆ transport() [2/2]

virtual void transport ( RTPTransport * trans)
virtual

Set the UDP transport of data handled by this session

Parameters
transA pointer to the new RTPTransport for this session

Reimplemented in RTPSession.


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