Bayonne2 / Common C++ 2 Framework
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Attributes
RTPDuplex Class Reference

A peer associated RTP socket pair for physically connected peer hosts. More...

#include <cc++/rtp.h>

Inheritance diagram for RTPDuplex:
Inheritance graph
[legend]
Collaboration diagram for RTPDuplex:
Collaboration graph
[legend]

Public Types

enum  Tos { tosBestEffort, tosEnhanced }
 rtp.h cc++/rtp.h More...
 
enum  Tos {
  tosLowDelay = 0, tosThroughput, tosReliability, tosMinCost,
  tosInvalid
}
 

Public Member Functions

 RTPDuplex (const InetAddress &bind, tpport_t local, tpport_t remote)
 
virtual ~RTPDuplex ()
 
UDPTransmit::Error connect (const InetHostAddress &host, tpport_t port=0)
 
void setTypeOfService (Tos tos)
 Specify the kind of service the application expects to use. More...
 
void enableStack ()
 Enable packet queue processing in the stack. More...
 
void disableStack ()
 Disable packet queue processing in the stack. More...
 
bool isActive () const
 Get active connection state flag. More...
 
uint32 getCurrentTimestamp () const
 Get the timestamp that should be given for a packet whose payload sampling instant corresponds to the current system time. More...
 
void setSessionBandwidth (uint32 bw)
 Specify the bandwidth of the current session. More...
 
uint32 getDefaultSessionBandwidth () const
 
uint32 getSessionBandwidth () const
 
void setTimeclock ()
 Set the packet timeclock for synchronizing timestamps. More...
 
timeout_t getTimeclock () const
 Get the packet timeclock for synchronizing timestamps. More...
 
SyncSourcesIterator begin ()
 
SyncSourcesIterator end ()
 
const AppDataUnitgetData (uint32 stamp, const SyncSource *src=NULL)
 Retreive data from a specific timestamped packet if such a packet is currently available in the receive buffer. More...
 
bool isWaiting (const SyncSource *src=NULL) const
 Determine if packets are waiting in the reception queue. More...
 
uint32 getFirstTimestamp (const SyncSource *src=NULL) const
 Get timestamp of first packet waiting in the queue. More...
 
void setMinValidPacketSequence (uint8 packets)
 When receiving packets from a new source, it may be convenient to reject a first few packets before we are really sure the source is valid. More...
 
uint8 getDefaultMinValidPacketSequence () const
 
uint8 getMinValidPacketSequence () const
 Get the minimun number of consecutive packets that must be received from a source before accepting its data packets. More...
 
void setMaxPacketMisorder (uint16 packets)
 
uint16 getDefaultMaxPacketMisorder () const
 
uint16 getMaxPacketMisorder () const
 
void setMaxPacketDropout (uint16 packets)
 It also prevents packets sent after a restart of the source being immediately accepted. More...
 
uint16 getDefaultMaxPacketDropout () const
 
uint16 getMaxPacketDropout () const
 
void setInQueueCryptoContext (CryptoContext *cc)
 Set input queue CryptoContext. More...
 
void removeInQueueCryptoContext (CryptoContext *cc)
 Remove input queue CryptoContext. More...
 
CryptoContextgetInQueueCryptoContext (uint32 ssrc)
 Get an input queue CryptoContext identified by SSRC. More...
 
size_t getDefaultMaxRecvPacketSize () const
 
size_t getMaxRecvPacketSize () const
 
void setMaxRecvPacketSize (size_t maxsize)
 
bool setPayloadFormat (const PayloadFormat &pf)
 Set the payload format in use, for timing and payload type identification purposes. More...
 
uint32 getLocalSSRC () const
 
uint32 getCurrentRTPClockRate () const
 Get the clock rate in RTP clock units (for instance, 8000 units per second for PCMU, or 90000 units per second for MP2T). More...
 
PayloadType getCurrentPayloadType () const
 
timeval getInitialTime () const
 
bool addDestination (const InetHostAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0)
 
bool addDestination (const InetMcastAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0)
 
bool forgetDestination (const InetHostAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0)
 
bool forgetDestination (const InetMcastAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0)
 
void addContributor (uint32 csrc)
 Add csrc as the CSRC identifier of a new contributor. More...
 
bool removeContributor (uint32 csrc)
 Remove CSRC from the list of contributors. More...
 
bool isSending () const
 Determine if outgoing packets are waiting to send. More...
 
void putData (uint32 stamp, const unsigned char *data=NULL, size_t len=0)
 This is used to create a data packet in the send queue. More...
 
void sendImmediate (uint32 stamp, const unsigned char *data=NULL, size_t len=0)
 This is used to create a data packet and send it immediately. More...
 
void setPadding (uint8 paddinglen)
 Set padding. More...
 
void setMark (bool mark)
 Set marker bit for the packet in which the next data provided will be send. More...
 
bool getMark () const
 Get wheter the mark bit will be set in the next packet. More...
 
size_t setPartial (uint32 timestamp, unsigned char *data, size_t offset, size_t max)
 Set partial data for an already queued packet. More...
 
microtimeout_t getDefaultSchedulingTimeout () const
 
void setSchedulingTimeout (microtimeout_t to)
 Set the default scheduling timeout to use when no data packets are waiting to be sent. More...
 
microtimeout_t getDefaultExpireTimeout () const
 
void setExpireTimeout (microtimeout_t to)
 Set the "expired" timer for expiring packets pending in the send queue which have gone unsent and are already "too late" to be sent now. More...
 
microtimeout_t getExpireTimeout () const
 
uint32 getSendPacketCount () const
 Get the total number of packets sent so far. More...
 
uint32 getSendOctetCount () const
 Get the total number of octets (payload only) sent so far. More...
 
uint16 getSequenceNumber () const
 Get the sequence number of the next outgoing packet. More...
 
void setOutQueueCryptoContext (CryptoContext *cc)
 Set ouput queue CryptoContext. More...
 
void removeOutQueueCryptoContext (CryptoContext *cc)
 Remove output queue CryptoContext. More...
 
CryptoContextgetOutQueueCryptoContext (uint32 ssrc)
 Get an output queue CryptoContext identified by SSRC. More...
 
size_t getDefaultMaxSendSegmentSize ()
 
void setMaxSendSegmentSize (size_t size)
 Set maximum payload segment size before fragmenting sends. More...
 
size_t getMaxSendSegmentSize ()
 
void connect (const char *service)
 
Error setTimeToLive (char ttl)
 Set time to live. More...
 
ssize_t transmit (const char *buffer, size_t len)
 Transmit "send" to use "connected" send rather than sendto. More...
 
bool isOutputReady (unsigned long timeout=0l)
 See if output queue is empty for sending more packets. More...
 
Error setRouting (bool enable)
 
Error setTypeOfService (Tos tos)
 
Error setBroadcast (bool enable)
 
Error setLoopback (bool enable)
 Set the loopback. More...
 
void setPeer (const IPV4Host &host, tpport_t port)
 set the peer address to send message packets to. More...
 
void setPeer (const char *service)
 Associate socket with a named connection. More...
 
Socket::Error getInterfaceIndex (const char *ethX, int &InterfaceIndex)
 get the interface index for a named network device More...
 
Socket::Error join (const IPV4Multicast &ia, int InterfaceIndex)
 join a multicast group on a particular interface More...
 
ssize_t receive (void *buf, size_t len, bool reply=false)
 Receive a message from any host. More...
 
IPV4Host getIPV4Peer (tpport_t *port=NULL) const
 Examine address of sender of next waiting packet. More...
 
IPV4Host getPeer (tpport_t *port=NULL) const
 
ssize_t peek (void *buf, size_t len)
 Examine contents of next waiting packet. More...
 
Error disconnect (void)
 Disassociate this socket from any host connection. More...
 
IPV4Host getSender (tpport_t *port=NULL) const
 
IPV4Host getIPV4Local (tpport_t *port=NULL) const
 Get the local address and port number this socket is currently bound to. More...
 
IPV4Host getLocal (tpport_t *port=NULL) const
 
IPV4Host getIPV4NAT (tpport_t *port=NULL) const
 Perform NAT table lookup for this socket. More...
 
IPV4Host getNAT (tpport_t *port) const
 
void setCompletion (bool immediate)
 Used to specify blocking mode for the socket. More...
 
Error setLinger (bool linger)
 Enable lingering sockets on close. More...
 
bool isConnected (void) const
 Can test to see if this socket is "connected", and hence whether a "catch" can safely call getPeer(). More...
 
bool isActive (void) const
 Test to see if the socket is at least operating or if it is mearly initialized. More...
 
bool operator! () const
 Operator based testing to see if a socket is currently active. More...
 
bool isBroadcast (void) const
 Return if broadcast has been enabled for the specified socket. More...
 
bool isRouted (void) const
 Return if socket routing is enabled. More...
 
Error getErrorNumber (void) const
 Often used by a "catch" to fetch the last error of a thrown socket. More...
 
const char * getErrorString (void) const
 Often used by a "catch" to fetch the user set error string of a thrown socket, but only if EXTENDED error codes are used. More...
 
long getSystemError (void) const
 
const char * getSystemErrorString (void) const
 

Static Public Member Functions

static size_t getDefaultMembersSize ()
 
static bool check (Family fam)
 See if a specific protocol family is available in the current runtime environment. More...
 

Protected Types

enum  Family { IPV4 = AF_INET }
 
typedef enum Family Family
 
enum  Error {
  errSuccess = 0, errCreateFailed, errCopyFailed, errInput,
  errInputInterrupt, errResourceFailure, errOutput, errOutputInterrupt,
  errNotConnected, errConnectRefused, errConnectRejected, errConnectTimeout,
  errConnectFailed, errConnectInvalid, errConnectBusy, errConnectNoRoute,
  errBindingFailed, errBroadcastDenied, errRoutingDenied, errKeepaliveDenied,
  errServiceDenied, errServiceUnavailable, errMulticastDisabled, errTimeout,
  errNoDelay, errExtended, errLookupFail, errSearchErr,
  errInvalidValue
}
 
typedef enum Error Error
 
enum  Tos {
  tosLowDelay = 0, tosThroughput, tosReliability, tosMinCost,
  tosInvalid
}
 
enum  Pending { pendingInput, pendingOutput, pendingError }
 
typedef enum Pending Pending
 
enum  State {
  INITIAL, AVAILABLE, BOUND, CONNECTED,
  CONNECTING, STREAM
}
 
typedef enum State State
 

Protected Member Functions

bool isPendingData (microtimeout_t timeout)
 
size_t sendData (const unsigned char *const buffer, size_t len)
 
size_t recvData (unsigned char *buffer, size_t len, InetHostAddress &na, tpport_t &tp)
 
void setDataPeer (const InetAddress &, tpport_t)
 
void setControlPeer (const InetAddress &, tpport_t)
 
size_t getNextDataPacketSize () const
 
SyncSourcegetPeer ()
 
virtual void timerTick ()
 A plugin point for timer tick driven events. More...
 
void renewLocalSSRC ()
 
void endQueue ()
 This method ends the queue. More...
 
bool checkSSRCInIncomingRTPPkt (SyncSourceLink &sourceLink, bool is_new, InetAddress &na, tpport_t tp)
 Apply collision and loop detection and correction algorithm when receiving RTP data packets. More...
 
void setSourceExpirationPeriod (uint8 intervals)
 Set the number of RTCP intervals that the stack will wait to change the state of a source from stateActive to stateInactive, or to delete the source after being in stateInactive. More...
 
virtual size_t takeInDataPacket ()
 This function is used by the service thread to process the next incoming packet and place it in the receive list. More...
 
IncomingDataQueue::IncomingRTPPktLinkgetWaiting (uint32 timestamp, const SyncSource *src=NULL)
 This is used to fetch a packet in the receive queue and to expire packets older than the current timestamp. More...
 
bool recordReception (SyncSourceLink &srcLink, const IncomingRTPPkt &pkt, const timeval recvtime)
 Log reception of a new RTP packet from this source. More...
 
void recordExtraction (const IncomingRTPPkt &pkt)
 Log extraction of a packet from this source from the scheduled reception queue. More...
 
void purgeIncomingQueue ()
 
virtual void onNewSyncSource (const SyncSource &)
 Virtual called when a new synchronization source has joined the session. More...
 
virtual bool onRTPPacketRecv (IncomingRTPPkt &)
 A virtual function to support parsing of arriving packets to determine if they should be kept in the queue and to dispatch events. More...
 
virtual void onExpireRecv (IncomingRTPPkt &)
 A hook to filter packets in the receive queue that are being expired. More...
 
virtual bool onSRTPPacketError (IncomingRTPPkt &pkt, int32 errorCode)
 A hook that gets called if the decoding of an incoming SRTP was erroneous. More...
 
virtual bool end2EndDelayed (IncomingRTPPktLink &)
 
bool insertRecvPacket (IncomingRTPPktLink *packetLink)
 Insert a just received packet in the queue (both general and source specific queues). More...
 
void setLocalSSRC (uint32 ssrc)
 
uint32 getLocalSSRCNetwork () const
 
virtual size_t dispatchBYE (const std::string &)
 A plugin point for posting of BYE messages. More...
 
size_t getDefaultMembersHashSize ()
 
SyncSourceLinkgetLink (const SyncSource &source) const
 
bool isMine (const SyncSource &source) const
 Get whether a synchronization source is recorded in this membership controller. More...
 
bool isRegistered (uint32 ssrc)
 Returns whether there is already a synchronizacion source with "ssrc" SSRC identifier. More...
 
SyncSourceLinkgetSourceBySSRC (uint32 ssrc, bool &created)
 Get the description of a source by its ssrc identifier. More...
 
bool BYESource (uint32 ssrc)
 Mark the source identified by ssrc as having sent a BYE packet. More...
 
bool removeSource (uint32 ssrc)
 Remove the description of the source identified by ssrc More...
 
SyncSourceLinkgetFirst ()
 
SyncSourceLinkgetLast ()
 
uint32 getMembersCount ()
 
void setMembersCount (uint32 n)
 
uint32 getSendersCount ()
 
void setLink (SyncSource &source, void *link)
 
void setParticipant (SyncSource &source, Participant &p)
 
void setState (SyncSource &source, SyncSource::State ns)
 
void setSender (SyncSource &source, bool active)
 
void setDataTransportPort (SyncSource &source, tpport_t p)
 
void setControlTransportPort (SyncSource &source, tpport_t p)
 
void setNetworkAddress (SyncSource &source, InetAddress addr)
 
void setSDESItem (Participant *part, SDESItemType item, const std::string &val)
 
void setPRIVPrefix (Participant *part, const std::string val)
 
void addParticipant (RTPApplication &app, Participant &part)
 
void removeParticipant (RTPApplication &app, RTPApplication::ParticipantLink *pl)
 
ConflictingTransportAddresssearchDataConflict (InetAddress na, tpport_t dtp)
 
ConflictingTransportAddresssearchControlConflict (InetAddress na, tpport_t ctp)
 
void updateConflict (ConflictingTransportAddress &ca)
 
void addConflict (const InetAddress &na, tpport_t dtp, tpport_t ctp)
 
void dispatchImmediate (OutgoingRTPPkt *packet)
 This is used to write the RTP data packet to one or more destinations. More...
 
microtimeout_t getSchedulingTimeout ()
 This computes the timeout period for scheduling transmission of the next packet at the "head" of the send buffer. More...
 
size_t dispatchDataPacket ()
 This function is used by the service thread to process the next outgoing packet pending in the sending queue. More...
 
void setNextSeqNum (uint32 seqNum)
 For thoses cases in which the application requires a method to set the sequence number for the outgoing stream (such as for implementing the RTSP PLAY command). More...
 
uint32 getCurrentSeqNum (void)
 
void setInitialTimestamp (uint32 ts)
 
uint32 getInitialTimestamp ()
 
void purgeOutgoingQueue ()
 
bool isSingleDestination () const
 Get whether there is only a destination in the list. More...
 
TransportAddressgetFirstDestination () const
 
void lockDestinationList () const
 
void unlockDestinationList () const
 
void writeLockDestinationList () const
 
bool addDestinationToList (const InetAddress &ia, tpport_t data, tpport_t control)
 Locks the object before modifying it. More...
 
bool removeDestinationFromList (const InetAddress &ia, tpport_t dataPort, tpport_t controlPort)
 Locks the object before modifying it. More...
 
Error connect (const IPV4Host &host, tpport_t port)
 Associate this socket with a specified peer host. More...
 
void connect (const char *service)
 
bool isPendingReceive (timeout_t timeout)
 Check for pending data. More...
 
void endReceiver (void)
 End receiver. More...
 
SOCKET getReceiver (void) const
 
Error setRouting (bool enable)
 
Error setMulticast (bool enable)
 
Error join (const IPV4Multicast &ia)
 
Socket::Error join (const IPV4Multicast &ia, int InterfaceIndex)
 join a multicast group on a particular interface More...
 
Error drop (const IPV4Multicast &ia)
 
ssize_t receive (void *buf, size_t len)
 Receive a data packet from the connected peer host. More...
 
ssize_t receive (void *buf, size_t len, bool reply=false)
 Receive a message from any host. More...
 
bool isInputReady (timeout_t timeout=TIMEOUT_INF)
 See if input queue has data packets available. More...
 
Error setLoopback (bool enable)
 Set the loopback. More...
 
Error setTimeToLive (char ttl)
 Set time to live. More...
 
void setPeer (const IPV4Host &host, tpport_t port)
 set the peer address to send message packets to. More...
 
void setPeer (const char *service)
 Associate socket with a named connection. More...
 
Socket::Error getInterfaceIndex (const char *ethX, int &InterfaceIndex)
 get the interface index for a named network device More...
 
ssize_t send (const void *buf, size_t len)
 Send a message packet to a peer host. More...
 
IPV4Host getIPV4Peer (tpport_t *port=NULL) const
 Examine address of sender of next waiting packet. More...
 
IPV4Host getPeer (tpport_t *port=NULL) const
 
ssize_t peek (void *buf, size_t len)
 Examine contents of next waiting packet. More...
 
Error disconnect (void)
 Disassociate this socket from any host connection. More...
 
Error error (Error error, const char *err=NULL, long systemError=0) const
 This service is used to throw all socket errors which usually occur during the socket constructor. More...
 
void error (const char *err) const
 This service is used to throw application defined socket errors where the application specific error code is a string. More...
 
void setError (bool enable)
 This service is used to turn the error handler on or off for "throwing" exceptions by manipulating the thrown flag. More...
 
void endSocket (void)
 Used as the default destructor for ending a socket. More...
 
Error connectError (void)
 Used as a common handler for connection failure processing. More...
 
Error sendLimit (int limit=2048)
 Set the send limit. More...
 
Error receiveLimit (int limit=1)
 Set thr receive limit. More...
 
Error sendTimeout (timeout_t timer)
 Set the send timeout for sending raw network data. More...
 
Error receiveTimeout (timeout_t timer)
 Receive timeout for receiving raw network data. More...
 
Error sendBuffer (unsigned size)
 Set the protocol stack network kernel send buffer size associated with the socket. More...
 
Error receiveBuffer (unsigned size)
 Set the protocol stack network kernel receive buffer size associated with the socket. More...
 
Error bufferSize (unsigned size)
 Set the total protocol stack network kernel buffer size for both send and receive together. More...
 
Error setBroadcast (bool enable)
 Set the subnet broadcast flag for the socket. More...
 
Error setMulticastByFamily (bool enable, Family family=IPV4)
 Setting multicast binds the multicast interface used for the socket to the interface the socket itself has been implicitly bound to. More...
 
Error setLoopbackByFamily (bool enable, Family family=IPV4)
 Set the multicast loopback flag for the socket. More...
 
Error setTimeToLiveByFamily (unsigned char ttl, Family fam=IPV4)
 Set the multicast time to live for a multicast socket. More...
 
Error setNoDelay (bool enable)
 Enable/disable delaying packets (Nagle algorithm) More...
 
ssize_t readLine (char *buf, size_t len, timeout_t timeout=0)
 Process a logical input line from a socket descriptor directly. More...
 
virtual ssize_t readData (void *buf, size_t len, char separator=0, timeout_t t=0)
 Read in a block of len bytes with specific separator. More...
 
virtual ssize_t writeData (const void *buf, size_t len, timeout_t t=0)
 Write a block of len bytes to socket. More...
 
virtual IPV4Host getIPV4Sender (tpport_t *port=NULL) const
 May be used to examine the origin of data waiting in the socket receive queue. More...
 
IPV4Host getSender (tpport_t *port=NULL) const
 
IPV4Host getIPV4Local (tpport_t *port=NULL) const
 Get the local address and port number this socket is currently bound to. More...
 
IPV4Host getLocal (tpport_t *port=NULL) const
 
IPV4Host getIPV4NAT (tpport_t *port=NULL) const
 Perform NAT table lookup for this socket. More...
 
IPV4Host getNAT (tpport_t *port) const
 
void setCompletion (bool immediate)
 Used to specify blocking mode for the socket. More...
 
Error setLinger (bool linger)
 Enable lingering sockets on close. More...
 
Error setTypeOfService (Tos service)
 Set packet scheduling on platforms which support ip quality of service conventions. More...
 
bool isConnected (void) const
 Can test to see if this socket is "connected", and hence whether a "catch" can safely call getPeer(). More...
 
bool isActive (void) const
 Test to see if the socket is at least operating or if it is mearly initialized. More...
 
bool operator! () const
 Operator based testing to see if a socket is currently active. More...
 
bool isBroadcast (void) const
 Return if broadcast has been enabled for the specified socket. More...
 
bool isRouted (void) const
 Return if socket routing is enabled. More...
 
Error getErrorNumber (void) const
 Often used by a "catch" to fetch the last error of a thrown socket. More...
 
const char * getErrorString (void) const
 Often used by a "catch" to fetch the user set error string of a thrown socket, but only if EXTENDED error codes are used. More...
 
long getSystemError (void) const
 
const char * getSystemErrorString (void) const
 
virtual bool isPending (Pending pend, timeout_t timeout=TIMEOUT_INF)
 Get the status of pending operations. More...
 
Error connect (const IPV4Host &host, tpport_t port)
 Associate this socket with a specified peer host. More...
 
Error connect (const IPV4Broadcast &subnet, tpport_t port)
 Associate this socket with a subnet of peer hosts for subnet broadcasting. More...
 
Error connect (const IPV4Multicast &mgroup, tpport_t port)
 Associate this socket with a multicast group. More...
 
ssize_t send (const void *buf, size_t len)
 Transmit "send" to use "connected" send rather than sendto. More...
 
void endTransmitter (void)
 Stop transmitter. More...
 
SOCKET getTransmitter (void)
 
Error setMulticast (bool enable)
 
Error setTimeToLive (unsigned char ttl)
 
Error error (Error error, const char *err=NULL, long systemError=0) const
 This service is used to throw all socket errors which usually occur during the socket constructor. More...
 
void error (const char *err) const
 This service is used to throw application defined socket errors where the application specific error code is a string. More...
 
void setError (bool enable)
 This service is used to turn the error handler on or off for "throwing" exceptions by manipulating the thrown flag. More...
 
void endSocket (void)
 Used as the default destructor for ending a socket. More...
 
Error connectError (void)
 Used as a common handler for connection failure processing. More...
 
Error sendLimit (int limit=2048)
 Set the send limit. More...
 
Error receiveLimit (int limit=1)
 Set thr receive limit. More...
 
Error sendTimeout (timeout_t timer)
 Set the send timeout for sending raw network data. More...
 
Error receiveTimeout (timeout_t timer)
 Receive timeout for receiving raw network data. More...
 
Error sendBuffer (unsigned size)
 Set the protocol stack network kernel send buffer size associated with the socket. More...
 
Error receiveBuffer (unsigned size)
 Set the protocol stack network kernel receive buffer size associated with the socket. More...
 
Error bufferSize (unsigned size)
 Set the total protocol stack network kernel buffer size for both send and receive together. More...
 
Error setMulticastByFamily (bool enable, Family family=IPV4)
 Setting multicast binds the multicast interface used for the socket to the interface the socket itself has been implicitly bound to. More...
 
Error setLoopbackByFamily (bool enable, Family family=IPV4)
 Set the multicast loopback flag for the socket. More...
 
Error setTimeToLiveByFamily (unsigned char ttl, Family fam=IPV4)
 Set the multicast time to live for a multicast socket. More...
 
Error setNoDelay (bool enable)
 Enable/disable delaying packets (Nagle algorithm) More...
 
ssize_t readLine (char *buf, size_t len, timeout_t timeout=0)
 Process a logical input line from a socket descriptor directly. More...
 

Static Protected Member Functions

static bool check (Family fam)
 See if a specific protocol family is available in the current runtime environment. More...
 

Protected Attributes

ThreadLock recvLock
 
IncomingRTPPktLinkrecvFirst
 
IncomingRTPPktLinkrecvLast
 
uint8 minValidPacketSequence
 
uint16 maxPacketMisorder
 
uint16 maxPacketDropout
 
uint8 sourceExpirationPeriod
 
Mutex cryptoMutex
 
Mutex cryptoMutex
 
std::list< CryptoContext * > cryptoContexts
 
std::list< CryptoContext * > cryptoContexts
 
ConflictingTransportAddressfirstConflict
 
ConflictingTransportAddresslastConflict
 
std::list< TransportAddress * > destList
 
union {
   struct sockaddr_in   ipv4
 
peer
 
Family family
 
struct {
   bool   thrown: 1
 
   bool   broadcast: 1
 
   bool   route: 1
 
   bool   keepalive: 1
 
   bool   loopback: 1
 
   bool   multicast: 1
 
   bool   completion: 1
 
   bool   linger: 1
 
   unsigned   ttl: 8
 
flags
 
SOCKET volatile so
 the actual socket descriptor, in Windows, unlike posix it cannot be used as an file descriptor that way madness lies – jfc More...
 
State volatile state
 
union {
   struct sockaddr_in   ipv4
 
peer
 
Family family
 
struct {
   bool   thrown: 1
 
   bool   broadcast: 1
 
   bool   route: 1
 
   bool   keepalive: 1
 
   bool   loopback: 1
 
   bool   multicast: 1
 
   bool   completion: 1
 
   bool   linger: 1
 
   unsigned   ttl: 8
 
flags
 
SOCKET volatile so
 the actual socket descriptor, in Windows, unlike posix it cannot be used as an file descriptor that way madness lies – jfc More...
 
State volatile state
 

Static Protected Attributes

static const uint8 defaultMinValidPacketSequence
 
static const uint16 defaultMaxPacketMisorder
 
static const uint16 defaultMaxPacketDropout
 
static const size_t defaultMembersSize
 
static const size_t defaultMembersHashSize
 
static const uint32 SEQNUMMOD
 
static Mutex mutex
 
static Mutex mutex
 

Private Attributes

tpport_t dataBasePort
 

Detailed Description

A peer associated RTP socket pair for physically connected peer hosts.

This has no RTCP and assumes the receiver is connected to a known transmitter, hence no "foreign" packets will arrive.

Author
David Sugar RTP peer host over UDP.

Definition at line 72 of file ext.h.

Member Typedef Documentation

typedef enum Error Socket::Error
inherited

Definition at line 163 of file socket.h.

typedef enum Family Socket::Family
inherited

Definition at line 129 of file socket.h.

typedef enum Pending Socket::Pending
inherited

Definition at line 179 of file socket.h.

typedef enum State Socket::State
protectedinherited

Definition at line 190 of file socket.h.

Member Enumeration Documentation

enum Socket::Error
inherited
Enumerator
errSuccess 
errCreateFailed 
errCopyFailed 
errInput 
errInputInterrupt 
errResourceFailure 
errOutput 
errOutputInterrupt 
errNotConnected 
errConnectRefused 
errConnectRejected 
errConnectTimeout 
errConnectFailed 
errConnectInvalid 
errConnectBusy 
errConnectNoRoute 
errBindingFailed 
errBroadcastDenied 
errRoutingDenied 
errKeepaliveDenied 
errServiceDenied 
errServiceUnavailable 
errMulticastDisabled 
errTimeout 
errNoDelay 
errExtended 
errLookupFail 
errSearchErr 
errInvalidValue 

Definition at line 131 of file socket.h.

enum Socket::Family
inherited
Enumerator
IPV4 

Definition at line 122 of file socket.h.

enum Socket::Pending
inherited
Enumerator
pendingInput 
pendingOutput 
pendingError 

Definition at line 174 of file socket.h.

enum Socket::State
protectedinherited
Enumerator
INITIAL 
AVAILABLE 
BOUND 
CONNECTED 
CONNECTING 
STREAM 

Definition at line 182 of file socket.h.

enum RTPDataQueue::Tos
inherited

rtp.h cc++/rtp.h

Type of network service the application uses.

If the application uses enhanced network service, for instance Integrated Services or Differentiated Services, it has not to ensure fair competition with TCP, provided that the requested service is actually being delivered. Whenever the application uses best-effort service or the requested enhanced service is not actually being delivered, it has to ensure fair competition with TCP. By default, best-effot is assumed.

Note
Although not required, RTP packets are always sent on top of UDP segments. No other underlying transport protocol is supported at present.
Todo:
implement fair competition with tcp
Enumerator
tosBestEffort 

Best-effort network service.

tosEnhanced 

Enhanced network service.

Definition at line 101 of file ioqueue.h.

enum Socket::Tos
inherited
Enumerator
tosLowDelay 
tosThroughput 
tosReliability 
tosMinCost 
tosInvalid 

Definition at line 165 of file socket.h.

enum Socket::Tos
inherited
Enumerator
tosLowDelay 
tosThroughput 
tosReliability 
tosMinCost 
tosInvalid 

Definition at line 165 of file socket.h.

Constructor & Destructor Documentation

RTPDuplex::RTPDuplex ( const InetAddress bind,
tpport_t  local,
tpport_t  remote 
)
Parameters
bindnetwork address this socket is to be bound
localtransport port this socket is to be bound
remotepeer transpor port
virtual RTPDuplex::~RTPDuplex ( )
virtual

Member Function Documentation

void ConflictHandler::addConflict ( const InetAddress na,
tpport_t  dtp,
tpport_t  ctp 
)
inherited
void OutgoingDataQueue::addContributor ( uint32  csrc)
inherited

Add csrc as the CSRC identifier of a new contributor.

This method adds the CSRC identifier to a list of contributors that will be inserted in every packet enqueued from now on.

bool OutgoingDataQueue::addDestination ( const InetHostAddress ia,
tpport_t  dataPort = DefaultRTPDataPort,
tpport_t  controlPort = 0 
)
inherited
bool OutgoingDataQueue::addDestination ( const InetMcastAddress ia,
tpport_t  dataPort = DefaultRTPDataPort,
tpport_t  controlPort = 0 
)
inherited
bool DestinationListHandler::addDestinationToList ( const InetAddress ia,
tpport_t  data,
tpport_t  control 
)
protectedinherited

Locks the object before modifying it.

void ApplicationHandler::addParticipant ( RTPApplication app,
Participant part 
)
inlineinherited

Definition at line 212 of file iqueue.h.

SyncSourcesIterator IncomingDataQueue::begin ( )
inlineinherited

Definition at line 938 of file iqueue.h.

Error Socket::bufferSize ( unsigned  size)
protectedinherited

Set the total protocol stack network kernel buffer size for both send and receive together.

Returns
errSuccess on success
Parameters
sizeof buffer.
Error Socket::bufferSize ( unsigned  size)
protectedinherited

Set the total protocol stack network kernel buffer size for both send and receive together.

Returns
errSuccess on success
Parameters
sizeof buffer.
bool MembershipBookkeeping::BYESource ( uint32  ssrc)
protectedinherited

Mark the source identified by ssrc as having sent a BYE packet.

It is not deleted until a timeout expires, so that in case some packets from this source arrive a bit later the source is not inserted again in the table of known sources.

Returns
true if the source had been previously identified. false if it was not in the table of known sources.
static bool Socket::check ( Family  fam)
staticinherited

See if a specific protocol family is available in the current runtime environment.

Returns
true if family available.
static bool Socket::check ( Family  fam)
staticinherited

See if a specific protocol family is available in the current runtime environment.

Returns
true if family available.
bool IncomingDataQueue::checkSSRCInIncomingRTPPkt ( SyncSourceLink sourceLink,
bool  is_new,
InetAddress na,
tpport_t  tp 
)
protectedinherited

Apply collision and loop detection and correction algorithm when receiving RTP data packets.

Follows section 8.2 in draft-ietf-avt-rtp-new.

Parameters
sourceLinklink to the source object.
is_newwhether the source has been just recorded.
nadata packet network address.
tpdata packet source transport port.
Returns
whether the packet must not be discarded.
UDPTransmit::Error RTPDuplex::connect ( const InetHostAddress host,
tpport_t  port = 0 
)
Parameters
hostpeer address
portpeer port. If not specified, the same as the local is used
Returns
socket status
void UDPSocket::connect ( const char *  service)
inherited
void UDPSocket::connect ( const char *  service)
inherited
Error UDPTransmit::connect ( const IPV4Host host,
tpport_t  port 
)
protectedinherited

Associate this socket with a specified peer host.

The port number from the constructor will be used. All UDP packets will be sent to and received from the specified host.

Returns
0 on success, -1 on error.
Parameters
hostaddress to connect socket to.
portto connect socket to.
Error UDPTransmit::connect ( const IPV4Broadcast subnet,
tpport_t  port 
)
protectedinherited

Associate this socket with a subnet of peer hosts for subnet broadcasting.

The server must be able to assert broadcast permission for the socket.

Returns
0 on success, -1 on error.
Parameters
subnetsubnet address to broadcast into.
porttransport port to broadcast into.
Error UDPTransmit::connect ( const IPV4Multicast mgroup,
tpport_t  port 
)
protectedinherited

Associate this socket with a multicast group.

Returns
0 on success, -1 on error.
Parameters
mgroupaddress of the multicast group to send to.
portport number
Error UDPReceive::connect ( const IPV4Host host,
tpport_t  port 
)
protectedinherited

Associate this socket with a specified peer host.

The port number from the constructor will be used. All UDP packets will be sent received from the specified host.

Returns
0 on success, -1 on error.
Parameters
hosthost network address to connect socket to.
porthost transport port to connect socket to.
Error Socket::connectError ( void  )
protectedinherited

Used as a common handler for connection failure processing.

Returns
correct failure code to apply.
Error Socket::connectError ( void  )
protectedinherited

Used as a common handler for connection failure processing.

Returns
correct failure code to apply.
void RTPDataQueue::disableStack ( )
inlineinherited

Disable packet queue processing in the stack.

Definition at line 132 of file ioqueue.h.

Error UDPSocket::disconnect ( void  )
inherited

Disassociate this socket from any host connection.

No data should be read or written until a connection is established.

Error UDPSocket::disconnect ( void  )
inherited

Disassociate this socket from any host connection.

No data should be read or written until a connection is established.

virtual size_t RTPQueueBase::dispatchBYE ( const std::string &  )
inlineprotectedvirtualinherited

A plugin point for posting of BYE messages.

Parameters
-reason to leave the RTP session.
Returns
number of octets sent.

Reimplemented in QueueRTCPManager.

Definition at line 231 of file queuebase.h.

size_t OutgoingDataQueue::dispatchDataPacket ( )
protectedinherited

This function is used by the service thread to process the next outgoing packet pending in the sending queue.

Returns
number of bytes sent. 0 if silent, <0 if error.
void OutgoingDataQueue::dispatchImmediate ( OutgoingRTPPkt packet)
protectedinherited

This is used to write the RTP data packet to one or more destinations.

It is used by both sendImmediate and by dispatchDataPacket.

Parameters
RTPpacket to send.
Error UDPReceive::drop ( const IPV4Multicast ia)
inlineprotectedinherited

Definition at line 1293 of file socket.h.

void RTPDataQueue::enableStack ( )
inlineinherited

Enable packet queue processing in the stack.

This method will not any thread of execution.

Definition at line 126 of file ioqueue.h.

SyncSourcesIterator IncomingDataQueue::end ( void  )
inlineinherited

Definition at line 941 of file iqueue.h.

virtual bool IncomingDataQueue::end2EndDelayed ( IncomingRTPPktLink )
inlineprotectedvirtualinherited

Reimplemented in QueueRTCPManager.

Definition at line 1238 of file iqueue.h.

void RTPDataQueue::endQueue ( )
protectedinherited

This method ends the queue.

void UDPReceive::endReceiver ( void  )
inlineprotectedinherited

End receiver.

Definition at line 1273 of file socket.h.

void Socket::endSocket ( void  )
protectedinherited

Used as the default destructor for ending a socket.

This will cleanly terminate the socket connection. It is provided for use in derived virtual destructors.

void Socket::endSocket ( void  )
protectedinherited

Used as the default destructor for ending a socket.

This will cleanly terminate the socket connection. It is provided for use in derived virtual destructors.

void UDPTransmit::endTransmitter ( void  )
inlineprotectedinherited

Stop transmitter.

Definition at line 1171 of file socket.h.

Error Socket::error ( Error  error,
const char *  err = NULL,
long  systemError = 0 
) const
protectedinherited

This service is used to throw all socket errors which usually occur during the socket constructor.

Parameters
errordefined socket error id.
errstring or message to pass.
systemErrorthe system error# that caused the error
Error Socket::error ( Error  error,
const char *  err = NULL,
long  systemError = 0 
) const
protectedinherited

This service is used to throw all socket errors which usually occur during the socket constructor.

Parameters
errordefined socket error id.
errstring or message to pass.
systemErrorthe system error# that caused the error
void Socket::error ( const char *  err) const
inlineprotectedinherited

This service is used to throw application defined socket errors where the application specific error code is a string.

Parameters
errstring or message to pass.

Definition at line 240 of file socket.h.

void Socket::error ( const char *  err) const
inlineprotectedinherited

This service is used to throw application defined socket errors where the application specific error code is a string.

Parameters
errstring or message to pass.

Definition at line 240 of file socket.h.

bool OutgoingDataQueue::forgetDestination ( const InetHostAddress ia,
tpport_t  dataPort = DefaultRTPDataPort,
tpport_t  controlPort = 0 
)
inherited
bool OutgoingDataQueue::forgetDestination ( const InetMcastAddress ia,
tpport_t  dataPort = DefaultRTPDataPort,
tpport_t  controlPort = 0 
)
inherited
PayloadType RTPQueueBase::getCurrentPayloadType ( ) const
inlineinherited

Definition at line 201 of file queuebase.h.

uint32 RTPQueueBase::getCurrentRTPClockRate ( ) const
inlineinherited

Get the clock rate in RTP clock units (for instance, 8000 units per second for PCMU, or 90000 units per second for MP2T).

This value depends on what payload format has been selected using setPayloadFormat().

Returns
clock rate in RTP clock units.

Definition at line 198 of file queuebase.h.

uint32 OutgoingDataQueue::getCurrentSeqNum ( void  )
inlineprotectedinherited

Definition at line 525 of file oqueue.h.

uint32 RTPDataQueue::getCurrentTimestamp ( ) const
inherited

Get the timestamp that should be given for a packet whose payload sampling instant corresponds to the current system time.

The timestamp applications should provide for each packet represents the sampling instant of its payload and should not be a reading of the system clock. Nevertheless, the internal operation of the RTP stack relies on the accuracy of the provided timestamp, since several computations assume that there is a certain degree of correspondence between the timestamp and the system clock.

It is recommended that applications use this method in order to periodically adjust the RTP timestamp.

In particular, it is advisable getting the timestamp corresponding to the first sampling instant or any instant after a period of inactivity through a call to this method.

Applications should use the nominal sampling or any other value provided by the coder in order to compute the next timestamps with minimum computational requirement.

For instance, an application using an RTP profile that specifies a fixed sampling rate of 8 Khz with eight bits per sample, continuously transmitting audio blocks 80 octets long, would transmit 100 packets every second. Every packet would carry a timestamp 80 units greater than the previous one. So, the first timestamp would be obtained from this method, whereas the following ones would be computed adding 80 every time. Also the timestamp should be increased for every block whether it is put in the queue or dropped.

The aforementioned increment can be obtained from the RTPDataQueue::getTimestampIncrement() method rather than computing it by hand in the application.

Note
Frame based applications must follow a specific timestamping method, probably specified in a profile.
You should take into account that by default ccRTP assumes that the application begins sampling at the queue creation time. Moreover, the first sampling instant is assigned a "user visible" timestamp of 0, although the RTP stack will then add internally a ramdom offset unknown to the application. That is to say, the application may count samples from 0 in order to get the timestamp for the next packet, provided that the first sampling instant is the same as the queue creation time. Nevertheless, this simpler way of starting will not be as accurate as it would be if the application got at least the first timestamp through getCurrentTimestamp. We provide this option since ccRTP interface is evolving, but we admit that it is ugly, we could remove this option or even replace uint32 timestamps with a restrictively regulated object; suggestions are gladly welcomed
const AppDataUnit* IncomingDataQueue::getData ( uint32  stamp,
const SyncSource src = NULL 
)
inherited

Retreive data from a specific timestamped packet if such a packet is currently available in the receive buffer.

Parameters
stampData unit timestamp.
srcOptional synchronization source selector.
Returns
data retrieved from the reception buffer.
Return values
nullpointer if no packet with such timestamp is available.
microtimeout_t OutgoingDataQueue::getDefaultExpireTimeout ( ) const
inlineinherited

Definition at line 371 of file oqueue.h.

uint16 IncomingDataQueue::getDefaultMaxPacketDropout ( ) const
inlineinherited

Definition at line 1035 of file iqueue.h.

uint16 IncomingDataQueue::getDefaultMaxPacketMisorder ( ) const
inlineinherited

Definition at line 1018 of file iqueue.h.

size_t IncomingDataQueueBase::getDefaultMaxRecvPacketSize ( ) const
inlineinherited

Definition at line 301 of file queuebase.h.

size_t OutgoingDataQueueBase::getDefaultMaxSendSegmentSize ( )
inlineinherited

Definition at line 262 of file queuebase.h.

size_t MembershipBookkeeping::getDefaultMembersHashSize ( )
inlineinherited

Definition at line 309 of file iqueue.h.

static size_t IncomingDataQueue::getDefaultMembersSize ( )
inlinestaticinherited

Definition at line 1045 of file iqueue.h.

uint8 IncomingDataQueue::getDefaultMinValidPacketSequence ( ) const
inlineinherited

Definition at line 1002 of file iqueue.h.

microtimeout_t OutgoingDataQueue::getDefaultSchedulingTimeout ( ) const
inlineinherited

Definition at line 357 of file oqueue.h.

uint32 RTPDataQueue::getDefaultSessionBandwidth ( ) const
inlineinherited

Definition at line 218 of file ioqueue.h.

Error Socket::getErrorNumber ( void  ) const
inlineinherited

Often used by a "catch" to fetch the last error of a thrown socket.

Returns
error number of Error error.

Definition at line 668 of file socket.h.

Error Socket::getErrorNumber ( void  ) const
inlineinherited

Often used by a "catch" to fetch the last error of a thrown socket.

Returns
error number of Error error.

Definition at line 668 of file socket.h.

const char* Socket::getErrorString ( void  ) const
inlineinherited

Often used by a "catch" to fetch the user set error string of a thrown socket, but only if EXTENDED error codes are used.

Returns
string for error message.

Definition at line 676 of file socket.h.

const char* Socket::getErrorString ( void  ) const
inlineinherited

Often used by a "catch" to fetch the user set error string of a thrown socket, but only if EXTENDED error codes are used.

Returns
string for error message.

Definition at line 676 of file socket.h.

microtimeout_t OutgoingDataQueue::getExpireTimeout ( ) const
inlineinherited

Definition at line 385 of file oqueue.h.

SyncSourceLink* MembershipBookkeeping::getFirst ( void  )
inlineprotectedinherited

Definition at line 836 of file iqueue.h.

TransportAddress* DestinationListHandler::getFirstDestination ( ) const
inlineinherited

Definition at line 85 of file oqueue.h.

uint32 IncomingDataQueue::getFirstTimestamp ( const SyncSource src = NULL) const
inherited

Get timestamp of first packet waiting in the queue.

Parameters
srcoptional source selector.
Returns
timestamp of first arrival packet.
timeval RTPQueueBase::getInitialTime ( ) const
inlineinherited

Definition at line 204 of file queuebase.h.

uint32 OutgoingDataQueue::getInitialTimestamp ( )
inlineprotectedinherited

Definition at line 537 of file oqueue.h.

CryptoContext* IncomingDataQueue::getInQueueCryptoContext ( uint32  ssrc)
inherited

Get an input queue CryptoContext identified by SSRC.

Parameters
ssrcRequest CryptoContext for this incoming SSRC
Returns
Pointer to CryptoContext of the SSRC of NULL if no context available for this SSRC.
Socket::Error UDPSocket::getInterfaceIndex ( const char *  ethX,
int &  InterfaceIndex 
)
inherited

get the interface index for a named network device

Parameters
ethXis device name, like "eth0" or "eth1"
InterfaceIndexis the index value returned by os
Todo:
Win32 and ipv6 specific implementation.
Socket::Error UDPSocket::getInterfaceIndex ( const char *  ethX,
int &  InterfaceIndex 
)
inherited

get the interface index for a named network device

Parameters
ethXis device name, like "eth0" or "eth1"
InterfaceIndexis the index value returned by os
Todo:
Win32 and ipv6 specific implementation.
IPV4Host Socket::getIPV4Local ( tpport_t port = NULL) const
inherited

Get the local address and port number this socket is currently bound to.

Parameters
portptr to port number on local host.
Returns
host address of interface this socket is bound to.
IPV4Host Socket::getIPV4Local ( tpport_t port = NULL) const
inherited

Get the local address and port number this socket is currently bound to.

Parameters
portptr to port number on local host.
Returns
host address of interface this socket is bound to.
IPV4Host Socket::getIPV4NAT ( tpport_t port = NULL) const
inherited

Perform NAT table lookup for this socket.

Used to allow an application to know the original ip:port pair the the client "thinks" it is connecting to. Used mostly to transparently impersonate a remote server/service.

On error, 0.0.0.0:0 is returned and one of the following error codes is set: errServiceUnavailable - if nat is not supported on the current platform or if it was not compiled; errLookupFail - if the nat syscall failed for some reason (extended error code); errSearchErr - if the socket does not have nat information (i.e. is not nated).

NAT lookup is supported on NetFilter for ipv4 and ipv6 (Linux), IPFilter for ipv4 (Solaris, *BSD except OpenBSD, HP-UX, etc.) and Packet Filter for ipv4 and ipv6 (OpenBSD). When using IPFilter or Packet Filter, the first NAT lookup must be performed as root (the NAT device is read only for root and is opened once, unless an error occurs). Permissions on the nat device may be changed to solve this.

Warning
When using IPFilter and Packet Filter, application data model must be the same as the running kernel (32/64 bits).
Parameters
portptr to NATed port number on local host.
Returns
NATed host address that this socket is related to.
IPV4Host Socket::getIPV4NAT ( tpport_t port = NULL) const
inherited

Perform NAT table lookup for this socket.

Used to allow an application to know the original ip:port pair the the client "thinks" it is connecting to. Used mostly to transparently impersonate a remote server/service.

On error, 0.0.0.0:0 is returned and one of the following error codes is set: errServiceUnavailable - if nat is not supported on the current platform or if it was not compiled; errLookupFail - if the nat syscall failed for some reason (extended error code); errSearchErr - if the socket does not have nat information (i.e. is not nated).

NAT lookup is supported on NetFilter for ipv4 and ipv6 (Linux), IPFilter for ipv4 (Solaris, *BSD except OpenBSD, HP-UX, etc.) and Packet Filter for ipv4 and ipv6 (OpenBSD). When using IPFilter or Packet Filter, the first NAT lookup must be performed as root (the NAT device is read only for root and is opened once, unless an error occurs). Permissions on the nat device may be changed to solve this.

Warning
When using IPFilter and Packet Filter, application data model must be the same as the running kernel (32/64 bits).
Parameters
portptr to NATed port number on local host.
Returns
NATed host address that this socket is related to.
IPV4Host UDPSocket::getIPV4Peer ( tpport_t port = NULL) const
inherited

Examine address of sender of next waiting packet.

This also sets "peer" address to the sender so that the next "send" message acts as a "reply". This additional behavior overides the standard socket getSender behavior.

Parameters
portpointer to hold port number.
IPV4Host UDPSocket::getIPV4Peer ( tpport_t port = NULL) const
inherited

Examine address of sender of next waiting packet.

This also sets "peer" address to the sender so that the next "send" message acts as a "reply". This additional behavior overides the standard socket getSender behavior.

Parameters
portpointer to hold port number.
virtual IPV4Host Socket::getIPV4Sender ( tpport_t port = NULL) const
virtualinherited

May be used to examine the origin of data waiting in the socket receive queue.

This can tell a TCP server where pending "connect" requests are coming from, or a UDP socket where it's next packet arrived from.

Parameters
portptr to port number of sender.
Returns
host address, test with "isInetAddress()".

Reimplemented in DCCPSocket.

SyncSourceLink* MembershipBookkeeping::getLast ( void  )
inlineprotectedinherited

Definition at line 839 of file iqueue.h.

SyncSourceLink* MembershipBookkeeping::getLink ( const SyncSource source) const
inlineprotectedinherited

Definition at line 339 of file iqueue.h.

IPV4Host Socket::getLocal ( tpport_t port = NULL) const
inlineinherited

Definition at line 539 of file socket.h.

IPV4Host Socket::getLocal ( tpport_t port = NULL) const
inlineinherited

Definition at line 539 of file socket.h.

uint32 RTPQueueBase::getLocalSSRC ( ) const
inlineinherited

Definition at line 187 of file queuebase.h.

uint32 RTPQueueBase::getLocalSSRCNetwork ( ) const
inlineprotectedinherited

Definition at line 217 of file queuebase.h.

bool OutgoingDataQueue::getMark ( ) const
inlineinherited

Get wheter the mark bit will be set in the next packet.

Definition at line 340 of file oqueue.h.

uint16 IncomingDataQueue::getMaxPacketDropout ( ) const
inlineinherited

Definition at line 1039 of file iqueue.h.

uint16 IncomingDataQueue::getMaxPacketMisorder ( ) const
inlineinherited

Definition at line 1022 of file iqueue.h.

size_t IncomingDataQueueBase::getMaxRecvPacketSize ( ) const
inlineinherited

Definition at line 305 of file queuebase.h.

size_t OutgoingDataQueueBase::getMaxSendSegmentSize ( )
inlineinherited

Definition at line 276 of file queuebase.h.

uint32 MembershipBookkeeping::getMembersCount ( )
inlineprotectedinherited

Definition at line 843 of file iqueue.h.

uint8 IncomingDataQueue::getMinValidPacketSequence ( ) const
inlineinherited

Get the minimun number of consecutive packets that must be received from a source before accepting its data packets.

Definition at line 1010 of file iqueue.h.

IPV4Host Socket::getNAT ( tpport_t port) const
inlineinherited

Definition at line 575 of file socket.h.

IPV4Host Socket::getNAT ( tpport_t port) const
inlineinherited

Definition at line 575 of file socket.h.

size_t RTPDuplex::getNextDataPacketSize ( ) const
inlineprotectedvirtual

Implements IncomingDataQueue.

Definition at line 147 of file ext.h.

CryptoContext* OutgoingDataQueue::getOutQueueCryptoContext ( uint32  ssrc)
inherited

Get an output queue CryptoContext identified by SSRC.

Parameters
ssrcRequest CryptoContext for this incoming SSRC
Returns
Pointer to CryptoContext of the SSRC of NULL if no context available for this SSRC.
SyncSource& RTPDuplex::getPeer ( )
protected
Returns
the associated peer information
IPV4Host UDPSocket::getPeer ( tpport_t port = NULL) const
inlineinherited

Definition at line 1014 of file socket.h.

IPV4Host UDPSocket::getPeer ( tpport_t port = NULL) const
inlineinherited

Definition at line 1014 of file socket.h.

SOCKET UDPReceive::getReceiver ( void  ) const
inlineprotectedinherited

Definition at line 1276 of file socket.h.

microtimeout_t OutgoingDataQueue::getSchedulingTimeout ( )
protectedinherited

This computes the timeout period for scheduling transmission of the next packet at the "head" of the send buffer.

If no packets are waiting, a default timeout is used. This actually forms the "isPending()" timeout of the rtp receiver in the service thread.

Returns
timeout until next packet is scheduled to send.
IPV4Host Socket::getSender ( tpport_t port = NULL) const
inlineinherited

Definition at line 505 of file socket.h.

IPV4Host Socket::getSender ( tpport_t port = NULL) const
inlineinherited

Definition at line 505 of file socket.h.

uint32 MembershipBookkeeping::getSendersCount ( )
inlineprotectedinherited

Definition at line 851 of file iqueue.h.

uint32 OutgoingDataQueue::getSendOctetCount ( ) const
inlineinherited

Get the total number of octets (payload only) sent so far.

Returns
total number of payload octets sent in RTP packets.

Definition at line 403 of file oqueue.h.

uint32 OutgoingDataQueue::getSendPacketCount ( ) const
inlineinherited

Get the total number of packets sent so far.

Returns
total number of packets sent

Definition at line 394 of file oqueue.h.

uint16 OutgoingDataQueue::getSequenceNumber ( ) const
inlineinherited

Get the sequence number of the next outgoing packet.

Returns
the 16 bit sequence number.

Definition at line 412 of file oqueue.h.

uint32 RTPDataQueue::getSessionBandwidth ( ) const
inlineinherited

Definition at line 222 of file ioqueue.h.

SyncSourceLink* MembershipBookkeeping::getSourceBySSRC ( uint32  ssrc,
bool &  created 
)
protectedinherited

Get the description of a source by its ssrc identifier.

Parameters
ssrcSSRC identifier, in host order.
createdwhether a new source has been created.
Returns
Pointer to the SyncSource object identified by ssrc.
long Socket::getSystemError ( void  ) const
inlineinherited

Definition at line 678 of file socket.h.

long Socket::getSystemError ( void  ) const
inlineinherited

Definition at line 678 of file socket.h.

const char* Socket::getSystemErrorString ( void  ) const
inherited
const char* Socket::getSystemErrorString ( void  ) const
inherited
timeout_t RTPDataQueue::getTimeclock ( ) const
inlineinherited

Get the packet timeclock for synchronizing timestamps.

Returns
runtime in milliseconds since last set.

Definition at line 238 of file ioqueue.h.

SOCKET UDPTransmit::getTransmitter ( void  )
inlineprotectedinherited

Definition at line 1179 of file socket.h.

IncomingDataQueue::IncomingRTPPktLink* IncomingDataQueue::getWaiting ( uint32  timestamp,
const SyncSource src = NULL 
)
protectedinherited

This is used to fetch a packet in the receive queue and to expire packets older than the current timestamp.

Returns
packet buffer object for current timestamp if found.
Parameters
timestamptimestamp requested.
srcoptional source selector
Note
if found, the packet is removed from the reception queue
bool IncomingDataQueue::insertRecvPacket ( IncomingRTPPktLink packetLink)
protectedinherited

Insert a just received packet in the queue (both general and source specific queues).

If the packet was already in the queue (same SSRC and sequence number), it is not inserted but deleted.

Parameters
packetLinklink to a packet just received and generally validated and processed by onRTPPacketRecv.
Returns
whether the packet was successfully inserted.
Return values
falsewhen the packet is duplicated (there is already a packet from the same source with the same timestamp).
truewhen the packet is not duplicated.
bool RTPDataQueue::isActive ( void  ) const
inlineinherited

Get active connection state flag.

Returns
true if connection "active".

Definition at line 141 of file ioqueue.h.

bool Socket::isActive ( void  ) const
inherited

Test to see if the socket is at least operating or if it is mearly initialized.

"initialized" sockets may be the result of failed constructors.

Returns
true if not in initial state.
bool Socket::isActive ( void  ) const
inherited

Test to see if the socket is at least operating or if it is mearly initialized.

"initialized" sockets may be the result of failed constructors.

Returns
true if not in initial state.
bool Socket::isBroadcast ( void  ) const
inlineinherited

Return if broadcast has been enabled for the specified socket.

Returns
true if broadcast socket.

Definition at line 651 of file socket.h.

bool Socket::isBroadcast ( void  ) const
inlineinherited

Return if broadcast has been enabled for the specified socket.

Returns
true if broadcast socket.

Definition at line 651 of file socket.h.

bool Socket::isConnected ( void  ) const
inherited

Can test to see if this socket is "connected", and hence whether a "catch" can safely call getPeer().

Of course, an unconnected socket will return a 0.0.0.0 address from getPeer() as well.

Returns
true when socket is connected to a peer.
bool Socket::isConnected ( void  ) const
inherited

Can test to see if this socket is "connected", and hence whether a "catch" can safely call getPeer().

Of course, an unconnected socket will return a 0.0.0.0 address from getPeer() as well.

Returns
true when socket is connected to a peer.
bool UDPReceive::isInputReady ( timeout_t  timeout = TIMEOUT_INF)
inlineinherited

See if input queue has data packets available.

Returns
true if data packets available.
Parameters
timeoutin milliseconds.

Definition at line 1318 of file socket.h.

bool MembershipBookkeeping::isMine ( const SyncSource source) const
inlineprotectedinherited

Get whether a synchronization source is recorded in this membership controller.

Definition at line 345 of file iqueue.h.

bool UDPTransmit::isOutputReady ( unsigned long  timeout = 0l)
inlineinherited

See if output queue is empty for sending more packets.

Returns
true if output available.
Parameters
timeoutin milliseconds to wait.

Definition at line 1207 of file socket.h.

virtual bool Socket::isPending ( Pending  pend,
timeout_t  timeout = TIMEOUT_INF 
)
virtualinherited

Get the status of pending operations.

This can be used to examine if input or output is waiting, or if an error has occured on the descriptor.

Returns
true if ready, false on timeout.
Parameters
pendready check to perform.
timeoutin milliseconds, inf. if not specified.

Reimplemented in SimpleTCPStream, TCPStream, and UnixStream.

bool RTPDuplex::isPendingData ( microtimeout_t  timeout)
inlineprotectedvirtual
Parameters
timeouthow much time to wait for new data
Returns
if there is some new data

Implements RTPDataQueue.

Definition at line 105 of file ext.h.

bool UDPReceive::isPendingReceive ( timeout_t  timeout)
inlineprotectedinherited

Check for pending data.

Returns
true if data is waiting.
Parameters
timeoutin milliseconds.

Definition at line 1267 of file socket.h.

bool MembershipBookkeeping::isRegistered ( uint32  ssrc)
protectedinherited

Returns whether there is already a synchronizacion source with "ssrc" SSRC identifier.

bool Socket::isRouted ( void  ) const
inlineinherited

Return if socket routing is enabled.

Returns
true if routing enabled.

Definition at line 659 of file socket.h.

bool Socket::isRouted ( void  ) const
inlineinherited

Return if socket routing is enabled.

Returns
true if routing enabled.

Definition at line 659 of file socket.h.

bool OutgoingDataQueue::isSending ( ) const
inherited

Determine if outgoing packets are waiting to send.

Returns
true if there are packets waiting to be send.
bool DestinationListHandler::isSingleDestination ( ) const
inlineinherited

Get whether there is only a destination in the list.

Definition at line 82 of file oqueue.h.

bool IncomingDataQueue::isWaiting ( const SyncSource src = NULL) const
inherited

Determine if packets are waiting in the reception queue.

Parameters
srcOptional synchronization source selector.
Returns
True if packets are waiting.
Socket::Error UDPSocket::join ( const IPV4Multicast ia,
int  InterfaceIndex 
)
inherited

join a multicast group on a particular interface

Parameters
iais the multicast address to use
InterfaceIndexis the index value returned by getInterfaceIndex
Todo:
Win32 and ipv6 specific implementation.
Socket::Error UDPSocket::join ( const IPV4Multicast ia,
int  InterfaceIndex 
)
inherited

join a multicast group on a particular interface

Parameters
iais the multicast address to use
InterfaceIndexis the index value returned by getInterfaceIndex
Todo:
Win32 and ipv6 specific implementation.
Error UDPReceive::join ( const IPV4Multicast ia)
inlineprotectedinherited

Definition at line 1285 of file socket.h.

void DestinationListHandler::lockDestinationList ( ) const
inlineinherited

Definition at line 88 of file oqueue.h.

virtual void IncomingDataQueue::onExpireRecv ( IncomingRTPPkt )
inlineprotectedvirtualinherited

A hook to filter packets in the receive queue that are being expired.

This hook may be used to do some application specific processing on expired packets before they are deleted.

Parameters
-packet expired from the recv queue.

Definition at line 1217 of file iqueue.h.

virtual void IncomingDataQueue::onNewSyncSource ( const SyncSource )
inlineprotectedvirtualinherited

Virtual called when a new synchronization source has joined the session.

Parameters
-new synchronization source

Definition at line 1185 of file iqueue.h.

virtual bool IncomingDataQueue::onRTPPacketRecv ( IncomingRTPPkt )
inlineprotectedvirtualinherited

A virtual function to support parsing of arriving packets to determine if they should be kept in the queue and to dispatch events.

A generic header validity check (as specified in RFC 1889) is performed on every incoming packet. If the generic check completes succesfully, this method is called before the packet is actually inserted into the reception queue.

May be used to perform additional validity checks or to do some application specific processing.

Parameters
-packet just received.
Returns
true if packet is kept in the incoming packets queue.

Definition at line 1206 of file iqueue.h.

virtual bool IncomingDataQueue::onSRTPPacketError ( IncomingRTPPkt pkt,
int32  errorCode 
)
inlineprotectedvirtualinherited

A hook that gets called if the decoding of an incoming SRTP was erroneous.

Parameters
pktThe SRTP packet with error.
errorCodeThe error code: -1 - SRTP authentication failure, -2 - replay check failed
Returns
True: put the packet in incoming queue for further processing by the applications; false: dismiss packet. The default implementation returns false.

Reimplemented in ZrtpQueue.

Definition at line 1234 of file iqueue.h.

bool Socket::operator! ( ) const
inherited

Operator based testing to see if a socket is currently active.

bool Socket::operator! ( ) const
inherited

Operator based testing to see if a socket is currently active.

ssize_t UDPSocket::peek ( void *  buf,
size_t  len 
)
inlineinherited

Examine contents of next waiting packet.

Parameters
bufpointer to packet buffer for contents.
lenof packet buffer.
Returns
number of bytes examined.

Definition at line 1028 of file socket.h.

ssize_t UDPSocket::peek ( void *  buf,
size_t  len 
)
inlineinherited

Examine contents of next waiting packet.

Parameters
bufpointer to packet buffer for contents.
lenof packet buffer.
Returns
number of bytes examined.

Definition at line 1028 of file socket.h.

void IncomingDataQueue::purgeIncomingQueue ( )
protectedinherited
void OutgoingDataQueue::purgeOutgoingQueue ( )
protectedinherited
void OutgoingDataQueue::putData ( uint32  stamp,
const unsigned char *  data = NULL,
size_t  len = 0 
)
inherited

This is used to create a data packet in the send queue.

Sometimes a "NULL" or empty packet will be used instead, and these are known as "silent" packets. "Silent" packets are used simply to "push" the scheduler along more accurately by giving the appearence that a next packet is waiting to be sent and to provide a valid timestamp for that packet.

Parameters
stampTimestamp for expected send time of packet.
dataValue or NULL if special "silent" packet.
lenMay be 0 to indicate a default by payload type.
virtual ssize_t Socket::readData ( void *  buf,
size_t  len,
char  separator = 0,
timeout_t  t = 0 
)
protectedvirtualinherited

Read in a block of len bytes with specific separator.

Can be zero, or any other char. If \n or \r, it's treated just like a readLine(). Otherwise it looks for the separator.

Parameters
bufpointer to byte allocation.
lenmaximum length to read.
separatorseparator for a particular ASCII character
ttimeout for pending data in milliseconds.
Returns
number of bytes actually read.
ssize_t Socket::readLine ( char *  buf,
size_t  len,
timeout_t  timeout = 0 
)
protectedinherited

Process a logical input line from a socket descriptor directly.

Parameters
bufpointer to string.
lenmaximum length to read.
timeoutfor pending data in milliseconds.
Returns
number of bytes actually read.
ssize_t Socket::readLine ( char *  buf,
size_t  len,
timeout_t  timeout = 0 
)
protectedinherited

Process a logical input line from a socket descriptor directly.

Parameters
bufpointer to string.
lenmaximum length to read.
timeoutfor pending data in milliseconds.
Returns
number of bytes actually read.
ssize_t UDPSocket::receive ( void *  buf,
size_t  len,
bool  reply = false 
)
inherited

Receive a message from any host.

Parameters
bufpointer to packet buffer to receive.
lenof packet buffer to receive.
replysave sender address for reply if true.
Returns
number of bytes received.
ssize_t UDPSocket::receive ( void *  buf,
size_t  len,
bool  reply = false 
)
inherited

Receive a message from any host.

Parameters
bufpointer to packet buffer to receive.
lenof packet buffer to receive.
replysave sender address for reply if true.
Returns
number of bytes received.
ssize_t UDPReceive::receive ( void *  buf,
size_t  len 
)
inlineinherited

Receive a data packet from the connected peer host.

Returns
num of bytes actually received.
Parameters
bufaddress of data receive buffer.
lensize of data receive buffer.

Definition at line 1309 of file socket.h.

Error Socket::receiveBuffer ( unsigned  size)
protectedinherited

Set the protocol stack network kernel receive buffer size associated with the socket.

Returns
errSuccess on success, or error.
Parameters
sizeof buffer in bytes.
Error Socket::receiveBuffer ( unsigned  size)
protectedinherited

Set the protocol stack network kernel receive buffer size associated with the socket.

Returns
errSuccess on success, or error.
Parameters
sizeof buffer in bytes.
Error Socket::receiveLimit ( int  limit = 1)
protectedinherited

Set thr receive limit.

Error Socket::receiveLimit ( int  limit = 1)
protectedinherited

Set thr receive limit.

Error Socket::receiveTimeout ( timeout_t  timer)
protectedinherited

Receive timeout for receiving raw network data.

Returns
errSuccess if set.
Parameters
timervalue in milliseconds.
Error Socket::receiveTimeout ( timeout_t  timer)
protectedinherited

Receive timeout for receiving raw network data.

Returns
errSuccess if set.
Parameters
timervalue in milliseconds.
void IncomingDataQueue::recordExtraction ( const IncomingRTPPkt pkt)
protectedinherited

Log extraction of a packet from this source from the scheduled reception queue.

Parameters
pktPacket extracted from the queue.
bool IncomingDataQueue::recordReception ( SyncSourceLink srcLink,
const IncomingRTPPkt pkt,
const timeval  recvtime 
)
protectedinherited

Log reception of a new RTP packet from this source.

Usually updates data such as the packet counter, the expected sequence number for the next packet and the time the last packet was received at.

Parameters
srcLinkLink structure for the synchronization source of this packet.
pktPacket just created and to be logged.
recvtimeReception time.
Returns
whether, according to the source state and statistics, the packet is considered valid and must be inserted in the incoming packets queue.
size_t RTPDuplex::recvData ( unsigned char *  buffer,
size_t  len,
InetHostAddress na,
tpport_t tp 
)
inlineprotectedvirtual
Parameters
bufferwhere to store the retrieved data
lenhow many octets to read
naSource network address.
tpSource transport port.
Returns
number of octets read

Implements IncomingDataQueue.

Definition at line 125 of file ext.h.

bool OutgoingDataQueue::removeContributor ( uint32  csrc)
inherited

Remove CSRC from the list of contributors.

bool DestinationListHandler::removeDestinationFromList ( const InetAddress ia,
tpport_t  dataPort,
tpport_t  controlPort 
)
protectedinherited

Locks the object before modifying it.

void IncomingDataQueue::removeInQueueCryptoContext ( CryptoContext cc)
inherited

Remove input queue CryptoContext.

The endQueue method (provided by RTPQueue) also deletes all registered CryptoContexts.

Parameters
ccPointer to initialized CryptoContext to remove. If pointer if NULL then delete the whole queue
void OutgoingDataQueue::removeOutQueueCryptoContext ( CryptoContext cc)
inherited

Remove output queue CryptoContext.

The endQueue method (provided by RTPQueue) also deletes all registered CryptoContexts.

Parameters
ccPointer to initialized CryptoContext to remove.
void ApplicationHandler::removeParticipant ( RTPApplication app,
RTPApplication::ParticipantLink pl 
)
inlineinherited

Definition at line 216 of file iqueue.h.

bool MembershipBookkeeping::removeSource ( uint32  ssrc)
protectedinherited

Remove the description of the source identified by ssrc

Returns
whether the source has been actually removed or it did not exist.
void RTPDataQueue::renewLocalSSRC ( )
inlineprotectedvirtualinherited

Reimplemented from RTPQueueBase.

Definition at line 284 of file ioqueue.h.

ConflictingTransportAddress* ConflictHandler::searchControlConflict ( InetAddress  na,
tpport_t  ctp 
)
inherited
Parameters
naInet network address.
ctpData transport port.
ConflictingTransportAddress* ConflictHandler::searchDataConflict ( InetAddress  na,
tpport_t  dtp 
)
inherited
Parameters
naInet network address.
dtpData transport port.
ssize_t UDPSocket::send ( const void *  buf,
size_t  len 
)
inherited

Send a message packet to a peer host.

Parameters
bufpointer to packet buffer to send.
lenof packet buffer to send.
Returns
number of bytes sent.
ssize_t UDPTransmit::send ( const void *  buf,
size_t  len 
)
inlineprotectedinherited

Transmit "send" to use "connected" send rather than sendto.

Returns
number of bytes sent.
Parameters
bufaddress of buffer to send.
lenof bytes to send.

Definition at line 1165 of file socket.h.

Error Socket::sendBuffer ( unsigned  size)
protectedinherited

Set the protocol stack network kernel send buffer size associated with the socket.

Returns
errSuccess on success, or error.
Parameters
sizeof buffer in bytes.
Error Socket::sendBuffer ( unsigned  size)
protectedinherited

Set the protocol stack network kernel send buffer size associated with the socket.

Returns
errSuccess on success, or error.
Parameters
sizeof buffer in bytes.
size_t RTPDuplex::sendData ( const unsigned char *const  buffer,
size_t  len 
)
inlineprotectedvirtual
Parameters
bufferpointer to data to be written
lenhow many octets to write
Returns
number of octets written

Reimplemented from OutgoingDataQueue.

Definition at line 114 of file ext.h.

void OutgoingDataQueue::sendImmediate ( uint32  stamp,
const unsigned char *  data = NULL,
size_t  len = 0 
)
inherited

This is used to create a data packet and send it immediately.

Sometimes a "NULL" or empty packet will be used instead, and these are known as "silent" packets. "Silent" packets are used simply to "push" the scheduler along more accurately by giving the appearence that a next packet is waiting to be sent and to provide a valid timestamp for that packet.

Parameters
stampTimestamp immediate send time of packet.
dataValue or NULL if special "silent" packet.
lenMay be 0 to indicate a default by payload type.
Error Socket::sendLimit ( int  limit = 2048)
protectedinherited

Set the send limit.

Error Socket::sendLimit ( int  limit = 2048)
protectedinherited

Set the send limit.

Error Socket::sendTimeout ( timeout_t  timer)
protectedinherited

Set the send timeout for sending raw network data.

Returns
errSuccess if set.
Parameters
timervalue in millisec.
Error Socket::sendTimeout ( timeout_t  timer)
protectedinherited

Set the send timeout for sending raw network data.

Returns
errSuccess if set.
Parameters
timervalue in millisec.
Error Socket::setBroadcast ( bool  enable)
protectedinherited

Set the subnet broadcast flag for the socket.

This enables sending to a subnet and may require special image privileges depending on the operating system.

Returns
0 (errSuccess) on success, else error code.
Parameters
enablewhen set to true.
Error UDPTransmit::setBroadcast ( bool  enable)
inlineinherited

Definition at line 1217 of file socket.h.

void Socket::setCompletion ( bool  immediate)
inherited

Used to specify blocking mode for the socket.

A socket can be made non-blocking by setting setCompletion(false) or set to block on all access with setCompletion(true). I do not believe this form of non-blocking socket I/O is supported in winsock, though it provides an alternate asynchronous set of socket services.

Parameters
immediatemode specify socket I/O call blocking mode.
void Socket::setCompletion ( bool  immediate)
inherited

Used to specify blocking mode for the socket.

A socket can be made non-blocking by setting setCompletion(false) or set to block on all access with setCompletion(true). I do not believe this form of non-blocking socket I/O is supported in winsock, though it provides an alternate asynchronous set of socket services.

Parameters
immediatemode specify socket I/O call blocking mode.
void RTPDuplex::setControlPeer ( const InetAddress ,
tpport_t   
)
inlineprotectedvirtual
Parameters
-peer host network address.
-peer host RTCP transport port.

Reimplemented from OutgoingDataQueue.

Definition at line 143 of file ext.h.

void SyncSourceHandler::setControlTransportPort ( SyncSource source,
tpport_t  p 
)
inlineinherited

Definition at line 161 of file iqueue.h.

void RTPDuplex::setDataPeer ( const InetAddress ,
tpport_t   
)
inlineprotectedvirtual
Parameters
-peer host network address.
-peer host RTP data transport port.

Reimplemented from OutgoingDataQueue.

Definition at line 135 of file ext.h.

void SyncSourceHandler::setDataTransportPort ( SyncSource source,
tpport_t  p 
)
inlineinherited

Definition at line 157 of file iqueue.h.

void Socket::setError ( bool  enable)
inlineprotectedinherited

This service is used to turn the error handler on or off for "throwing" exceptions by manipulating the thrown flag.

Parameters
enabletrue to enable handler.

Definition at line 249 of file socket.h.

void Socket::setError ( bool  enable)
inlineprotectedinherited

This service is used to turn the error handler on or off for "throwing" exceptions by manipulating the thrown flag.

Parameters
enabletrue to enable handler.

Definition at line 249 of file socket.h.

void OutgoingDataQueue::setExpireTimeout ( microtimeout_t  to)
inlineinherited

Set the "expired" timer for expiring packets pending in the send queue which have gone unsent and are already "too late" to be sent now.

Parameters
totimeout to expire unsent packets in milliseconds.

Definition at line 382 of file oqueue.h.

void OutgoingDataQueue::setInitialTimestamp ( uint32  ts)
inlineprotectedinherited

Definition at line 531 of file oqueue.h.

void IncomingDataQueue::setInQueueCryptoContext ( CryptoContext cc)
inherited

Set input queue CryptoContext.

The endQueue method (provided by RTPQueue) deletes all registered CryptoContexts.

Parameters
ccPointer to initialized CryptoContext.
Error Socket::setLinger ( bool  linger)
inherited

Enable lingering sockets on close.

Parameters
lingerspecify linger enable.
Error Socket::setLinger ( bool  linger)
inherited

Enable lingering sockets on close.

Parameters
lingerspecify linger enable.
void SyncSourceHandler::setLink ( SyncSource source,
void *  link 
)
inlineinherited

Definition at line 141 of file iqueue.h.

void RTPQueueBase::setLocalSSRC ( uint32  ssrc)
inlineprotectedinherited

Definition at line 214 of file queuebase.h.

Error UDPSocket::setLoopback ( bool  enable)
inlineinherited

Set the loopback.

Definition at line 937 of file socket.h.

Error UDPSocket::setLoopback ( bool  enable)
inlineinherited

Set the loopback.

Definition at line 937 of file socket.h.

Error Socket::setLoopbackByFamily ( bool  enable,
Family  family = IPV4 
)
protectedinherited

Set the multicast loopback flag for the socket.

Loopback enables a socket to hear what it is sending.

Returns
0 (errSuccess) on success, else error code.
Parameters
enablewhen set to true.
familyof protocol.
Error Socket::setLoopbackByFamily ( bool  enable,
Family  family = IPV4 
)
protectedinherited

Set the multicast loopback flag for the socket.

Loopback enables a socket to hear what it is sending.

Returns
0 (errSuccess) on success, else error code.
Parameters
enablewhen set to true.
familyof protocol.
void OutgoingDataQueue::setMark ( bool  mark)
inlineinherited

Set marker bit for the packet in which the next data provided will be send.

When transmitting audio, should be set for the first packet of a talk spurt. When transmitting video, should be set for the last packet for a video frame.

Parameters
markMarker bit value for next packet.

Definition at line 334 of file oqueue.h.

void IncomingDataQueue::setMaxPacketDropout ( uint16  packets)
inlineinherited

It also prevents packets sent after a restart of the source being immediately accepted.

Definition at line 1031 of file iqueue.h.

void IncomingDataQueue::setMaxPacketMisorder ( uint16  packets)
inlineinherited

Definition at line 1014 of file iqueue.h.

void IncomingDataQueueBase::setMaxRecvPacketSize ( size_t  maxsize)
inlineinherited
Parameters
maxsizemaximum length of received RTP data packets, in octets. Defaults to the value returned by getDefaultMaxRecvPacketSize().
Note
This method sets a filter for incoming packets. Setting higher values does not necessarily imply higher memory usage (this method does not set any buffer size).

Definition at line 319 of file queuebase.h.

void OutgoingDataQueueBase::setMaxSendSegmentSize ( size_t  size)
inlineinherited

Set maximum payload segment size before fragmenting sends.

Parameters
sizeMaximum payload size.
Returns
Whether segment size was successfully set.

Definition at line 272 of file queuebase.h.

void MembershipBookkeeping::setMembersCount ( uint32  n)
inlineprotectedinherited

Definition at line 847 of file iqueue.h.

void IncomingDataQueue::setMinValidPacketSequence ( uint8  packets)
inlineinherited

When receiving packets from a new source, it may be convenient to reject a first few packets before we are really sure the source is valid.

This method sets how many data packets must be received in sequence before the source is considered valid and the stack starts to accept its packets.

Note
the default (see defaultMinValidPacketSequence()) value for this parameter is 0, so that no packets are rejected (data packets are accepted from the first one).
this validation is performed after the generic header validation and the additional validation done in onRTPPacketRecv().
if any valid RTCP packet is received from this source, it will be immediatly considered valid regardless of the number of sequential data packets received.
Parameters
packetsnumber of sequential packet required

Definition at line 998 of file iqueue.h.

Error UDPTransmit::setMulticast ( bool  enable)
inlineprotectedinherited

Definition at line 1182 of file socket.h.

Error UDPReceive::setMulticast ( bool  enable)
inlineprotectedinherited

Definition at line 1282 of file socket.h.

Error Socket::setMulticastByFamily ( bool  enable,
Family  family = IPV4 
)
protectedinherited

Setting multicast binds the multicast interface used for the socket to the interface the socket itself has been implicitly bound to.

It is also used as a check flag to make sure multicast is enabled before multicast operations are used.

Returns
0 (errSuccess) on success, else error code.
Parameters
enablewhen set to true.
familyof protocol.
Error Socket::setMulticastByFamily ( bool  enable,
Family  family = IPV4 
)
protectedinherited

Setting multicast binds the multicast interface used for the socket to the interface the socket itself has been implicitly bound to.

It is also used as a check flag to make sure multicast is enabled before multicast operations are used.

Returns
0 (errSuccess) on success, else error code.
Parameters
enablewhen set to true.
familyof protocol.
void SyncSourceHandler::setNetworkAddress ( SyncSource source,
InetAddress  addr 
)
inlineinherited

Definition at line 165 of file iqueue.h.

void OutgoingDataQueue::setNextSeqNum ( uint32  seqNum)
inlineprotectedinherited

For thoses cases in which the application requires a method to set the sequence number for the outgoing stream (such as for implementing the RTSP PLAY command).

Parameters
seqNumnext sequence number to be used for outgoing packets.

Definition at line 521 of file oqueue.h.

Error Socket::setNoDelay ( bool  enable)
protectedinherited

Enable/disable delaying packets (Nagle algorithm)

Returns
0 on success.
Parameters
enabledisable Nagle algorithm when set to true.
Error Socket::setNoDelay ( bool  enable)
protectedinherited

Enable/disable delaying packets (Nagle algorithm)

Returns
0 on success.
Parameters
enabledisable Nagle algorithm when set to true.
void OutgoingDataQueue::setOutQueueCryptoContext ( CryptoContext cc)
inherited

Set ouput queue CryptoContext.

The endQueue method (provided by RTPQueue) deletes all registered CryptoContexts.

Parameters
ccPointer to initialized CryptoContext.
void OutgoingDataQueue::setPadding ( uint8  paddinglen)
inlineinherited

Set padding.

All outgoing packets will be transparently padded to a multiple of paddinglen.

Parameters
paddinglenpad packets to a length multiple of paddinglen.

Definition at line 323 of file oqueue.h.

size_t OutgoingDataQueue::setPartial ( uint32  timestamp,
unsigned char *  data,
size_t  offset,
size_t  max 
)
inherited

Set partial data for an already queued packet.

This is often used for multichannel data.

Parameters
timestampTimestamp of packet.
dataBuffer to copy from.
offsetOffset to copy from.
maxMaximum data size.
Returns
Number of packet data bytes set.
void SyncSourceHandler::setParticipant ( SyncSource source,
Participant p 
)
inlineinherited

Definition at line 145 of file iqueue.h.

bool RTPQueueBase::setPayloadFormat ( const PayloadFormat pf)
inlineinherited

Set the payload format in use, for timing and payload type identification purposes.

Parameters
pfpayload format to use from now on.
Returns
whether the payload format has been successfully set.

Definition at line 180 of file queuebase.h.

void UDPSocket::setPeer ( const IPV4Host host,
tpport_t  port 
)
inherited

set the peer address to send message packets to.

This can be set before every send() call if nessisary.

Parameters
hostaddress to send packets to.
portnumber to deliver packets to.
void UDPSocket::setPeer ( const IPV4Host host,
tpport_t  port 
)
inherited

set the peer address to send message packets to.

This can be set before every send() call if nessisary.

Parameters
hostaddress to send packets to.
portnumber to deliver packets to.
void UDPSocket::setPeer ( const char *  service)
inherited

Associate socket with a named connection.

void UDPSocket::setPeer ( const char *  service)
inherited

Associate socket with a named connection.

void ParticipantHandler::setPRIVPrefix ( Participant part,
const std::string  val 
)
inlineinherited

Definition at line 191 of file iqueue.h.

Error UDPTransmit::setRouting ( bool  enable)
inlineinherited

Definition at line 1211 of file socket.h.

Error UDPReceive::setRouting ( bool  enable)
inlineprotectedinherited

Definition at line 1279 of file socket.h.

void OutgoingDataQueue::setSchedulingTimeout ( microtimeout_t  to)
inlineinherited

Set the default scheduling timeout to use when no data packets are waiting to be sent.

Parameters
totimeout in milliseconds.

Definition at line 367 of file oqueue.h.

void ParticipantHandler::setSDESItem ( Participant part,
SDESItemType  item,
const std::string &  val 
)
inlineinherited

Definition at line 186 of file iqueue.h.

void SyncSourceHandler::setSender ( SyncSource source,
bool  active 
)
inlineinherited

Definition at line 153 of file iqueue.h.

void RTPDataQueue::setSessionBandwidth ( uint32  bw)
inlineinherited

Specify the bandwidth of the current session.

Parameters
bwbandwidth of the current session, in bits/s.
See Also
AVPQueue::setControlBandwidth()

Definition at line 214 of file ioqueue.h.

void IncomingDataQueue::setSourceExpirationPeriod ( uint8  intervals)
inlineprotectedinherited

Set the number of RTCP intervals that the stack will wait to change the state of a source from stateActive to stateInactive, or to delete the source after being in stateInactive.

Note that this value should be uniform accross all participants and SHOULD be fixed for a particular profile.

Parameters
intervalsnumber of RTCP report intervals
Note
If RTCP is not being used, the RTCP interval is assumed to be the default: 5 seconds.
The default for this value is, as RECOMMENDED, 5.

Definition at line 1122 of file iqueue.h.

void SyncSourceHandler::setState ( SyncSource source,
SyncSource::State  ns 
)
inlineinherited

Definition at line 149 of file iqueue.h.

void RTPDataQueue::setTimeclock ( )
inlineinherited

Set the packet timeclock for synchronizing timestamps.

Definition at line 229 of file ioqueue.h.

Error UDPSocket::setTimeToLive ( char  ttl)
inlineinherited

Set time to live.

Definition at line 949 of file socket.h.

Error UDPSocket::setTimeToLive ( char  ttl)
inlineinherited

Set time to live.

Definition at line 949 of file socket.h.

Error UDPTransmit::setTimeToLive ( unsigned char  ttl)
inlineprotectedinherited

Definition at line 1185 of file socket.h.

Error Socket::setTimeToLiveByFamily ( unsigned char  ttl,
Family  fam = IPV4 
)
protectedinherited

Set the multicast time to live for a multicast socket.

Returns
0 (errSuccess) on success, else error code.
Parameters
ttltime to live.
famfamily of protocol.
Error Socket::setTimeToLiveByFamily ( unsigned char  ttl,
Family  fam = IPV4 
)
protectedinherited

Set the multicast time to live for a multicast socket.

Returns
0 (errSuccess) on success, else error code.
Parameters
ttltime to live.
famfamily of protocol.
void RTPDataQueue::setTypeOfService ( Tos  tos)
inlineinherited

Specify the kind of service the application expects to use.

Parameters
tostype of service the application expects to use
Note
If enhanced service is specified but packet loss is high (the requested service does not appear to actually be delivered) ccRTP defaults to best-effort suitable behaviour: guarantee fair competition with TCP.
Todo:
Implement fair competition with tcp

Definition at line 119 of file ioqueue.h.

Error Socket::setTypeOfService ( Tos  service)
inherited

Set packet scheduling on platforms which support ip quality of service conventions.

This effects how packets in the queue are scheduled through the interface.

Returns
0 on success, error code on failure.
Parameters
servicetype of service enumerated type.
Error UDPTransmit::setTypeOfService ( Tos  tos)
inlineinherited

Definition at line 1214 of file socket.h.

virtual size_t IncomingDataQueue::takeInDataPacket ( )
protectedvirtualinherited

This function is used by the service thread to process the next incoming packet and place it in the receive list.

Returns
number of payload bytes received. <0 if error.

Reimplemented in ZrtpQueue.

virtual void RTPDataQueue::timerTick ( )
inlineprotectedvirtualinherited

A plugin point for timer tick driven events.

Definition at line 281 of file ioqueue.h.

ssize_t UDPTransmit::transmit ( const char *  buffer,
size_t  len 
)
inlineinherited

Transmit "send" to use "connected" send rather than sendto.

Note
Windows does not support MSG_DONTWAIT, so it is defined as 0 on that platform.
Returns
number of bytes sent.
Parameters
bufferaddress of buffer to send.
lenof bytes to send.

Definition at line 1198 of file socket.h.

void DestinationListHandler::unlockDestinationList ( ) const
inlineinherited

Definition at line 91 of file oqueue.h.

void ConflictHandler::updateConflict ( ConflictingTransportAddress ca)
inlineinherited

Definition at line 276 of file iqueue.h.

virtual ssize_t Socket::writeData ( const void *  buf,
size_t  len,
timeout_t  t = 0 
)
protectedvirtualinherited

Write a block of len bytes to socket.

Parameters
bufpointer to byte allocation.
lenmaximum length to write.
ttimeout for pending data in milliseconds.
Returns
number of bytes actually written.
void DestinationListHandler::writeLockDestinationList ( ) const
inlineprotectedinherited

Definition at line 95 of file oqueue.h.

Field Documentation

bool Socket::broadcast
inherited

Definition at line 206 of file socket.h.

bool Socket::broadcast
inherited

Definition at line 206 of file socket.h.

bool OutgoingDataQueue::complete
inherited

Definition at line 618 of file oqueue.h.

bool Socket::completion
inherited

Definition at line 211 of file socket.h.

bool Socket::completion
inherited

Definition at line 211 of file socket.h.

std::list<CryptoContext *> OutgoingDataQueue::cryptoContexts
protectedinherited

Definition at line 552 of file oqueue.h.

std::list<CryptoContext *> IncomingDataQueue::cryptoContexts
protectedinherited

Definition at line 1290 of file iqueue.h.

Mutex OutgoingDataQueue::cryptoMutex
mutableprotectedinherited

Definition at line 551 of file oqueue.h.

Mutex IncomingDataQueue::cryptoMutex
mutableprotectedinherited

Definition at line 1289 of file iqueue.h.

tpport_t RTPDuplex::dataBasePort
private

Definition at line 159 of file ext.h.

const uint16 IncomingDataQueue::defaultMaxPacketDropout
staticprotectedinherited

Definition at line 1283 of file iqueue.h.

const uint16 IncomingDataQueue::defaultMaxPacketMisorder
staticprotectedinherited

Definition at line 1282 of file iqueue.h.

const size_t MembershipBookkeeping::defaultMembersHashSize
staticprotectedinherited

Definition at line 854 of file iqueue.h.

const size_t IncomingDataQueue::defaultMembersSize
staticprotectedinherited

Definition at line 1287 of file iqueue.h.

const uint8 IncomingDataQueue::defaultMinValidPacketSequence
staticprotectedinherited

Definition at line 1281 of file iqueue.h.

std::list<TransportAddress*> DestinationListHandler::destList
protectedinherited

Definition at line 71 of file oqueue.h.

Family UDPSocket::family
protectedinherited

Definition at line 902 of file socket.h.

Family UDPSocket::family
protectedinherited

Definition at line 902 of file socket.h.

ConflictingTransportAddress* ConflictHandler::firstConflict
protectedinherited

Definition at line 288 of file iqueue.h.

struct { ... } Socket::flags
struct { ... } Socket::flags
struct sockaddr_in UDPSocket::ipv4
inherited

Definition at line 898 of file socket.h.

struct sockaddr_in UDPSocket::ipv4
inherited

Definition at line 898 of file socket.h.

bool Socket::keepalive
inherited

Definition at line 208 of file socket.h.

bool Socket::keepalive
inherited

Definition at line 208 of file socket.h.

ConflictingTransportAddress * ConflictHandler::lastConflict
protectedinherited

Definition at line 288 of file iqueue.h.

bool Socket::linger
inherited

Definition at line 212 of file socket.h.

bool Socket::linger
inherited

Definition at line 212 of file socket.h.

bool Socket::loopback
inherited

Definition at line 209 of file socket.h.

bool Socket::loopback
inherited

Definition at line 209 of file socket.h.

bool OutgoingDataQueue::marked
inherited

Definition at line 616 of file oqueue.h.

uint16 IncomingDataQueue::maxPacketDropout
protectedinherited

Definition at line 1286 of file iqueue.h.

uint16 IncomingDataQueue::maxPacketMisorder
protectedinherited

Definition at line 1285 of file iqueue.h.

uint8 IncomingDataQueue::minValidPacketSequence
protectedinherited

Definition at line 1284 of file iqueue.h.

bool Socket::multicast
inherited

Definition at line 210 of file socket.h.

bool Socket::multicast
inherited

Definition at line 210 of file socket.h.

Mutex Socket::mutex
staticprotectedinherited

Definition at line 202 of file socket.h.

Mutex Socket::mutex
staticprotectedinherited

Definition at line 202 of file socket.h.

uint32 OutgoingDataQueue::octetCount
inherited

Definition at line 604 of file oqueue.h.

timeval OutgoingDataQueue::overflowTime
inherited

Definition at line 623 of file oqueue.h.

uint32 OutgoingDataQueue::packetCount
inherited

Definition at line 602 of file oqueue.h.

uint8 OutgoingDataQueue::paddinglen
inherited

Definition at line 612 of file oqueue.h.

union { ... } UDPSocket::peer
union { ... } UDPSocket::peer
IncomingRTPPktLink* IncomingDataQueue::recvFirst
protectedinherited

Definition at line 1279 of file iqueue.h.

IncomingRTPPktLink * IncomingDataQueue::recvLast
protectedinherited

Definition at line 1279 of file iqueue.h.

ThreadLock IncomingDataQueue::recvLock
mutableprotectedinherited

Definition at line 1277 of file iqueue.h.

bool Socket::route
inherited

Definition at line 207 of file socket.h.

bool Socket::route
inherited

Definition at line 207 of file socket.h.

uint16 OutgoingDataQueue::sendCC
inherited

Definition at line 610 of file oqueue.h.

uint16 OutgoingDataQueue::sendSeq
inherited

Definition at line 606 of file oqueue.h.

uint32 OutgoingDataQueue::sendSources[16]
inherited

Definition at line 608 of file oqueue.h.

const uint32 MembershipBookkeeping::SEQNUMMOD
staticprotectedinherited

Definition at line 855 of file iqueue.h.

SOCKET volatile Socket::so
protectedinherited

the actual socket descriptor, in Windows, unlike posix it cannot be used as an file descriptor that way madness lies – jfc

Definition at line 221 of file socket.h.

SOCKET volatile Socket::so
protectedinherited

the actual socket descriptor, in Windows, unlike posix it cannot be used as an file descriptor that way madness lies – jfc

Definition at line 221 of file socket.h.

uint8 IncomingDataQueue::sourceExpirationPeriod
protectedinherited

Definition at line 1288 of file iqueue.h.

State volatile Socket::state
protectedinherited

Definition at line 222 of file socket.h.

State volatile Socket::state
protectedinherited

Definition at line 222 of file socket.h.

bool Socket::thrown
inherited

Definition at line 205 of file socket.h.

bool Socket::thrown
inherited

Definition at line 205 of file socket.h.

unsigned Socket::ttl
inherited

Definition at line 213 of file socket.h.

unsigned Socket::ttl
inherited

Definition at line 213 of file socket.h.


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