JRTPLIB  3.11.1
Public Member Functions | List of all members
jrtplib::RTPAbortDescriptors Class Reference

Helper class for several RTPTransmitter instances, to be able to cancel a call to 'select', 'poll' or 'WSAPoll'. More...

#include <rtpabortdescriptors.h>

Public Member Functions

int Init ()
 Initializes this instance. More...
 
SocketType GetAbortSocket () const
 Returns the socket descriptor that can be included in a call to 'select' (for example). More...
 
bool IsInitialized () const
 Returns a flag indicating if this instance was initialized. More...
 
void Destroy ()
 De-initializes this instance. More...
 
int SendAbortSignal ()
 Send a signal to the socket that's returned by RTPAbortDescriptors::GetAbortSocket, causing the 'select' call to detect that data is available, making the call end. More...
 
int ReadSignallingByte ()
 For each RTPAbortDescriptors::SendAbortSignal function that's called, a call to this function can be made to clear the state again. More...
 
int ClearAbortSignal ()
 Similar to ReadSignallingByte::ReadSignallingByte, this function clears the signalling state, but this also works independently from the amount of times that RTPAbortDescriptors::SendAbortSignal was called. More...
 

Detailed Description

This is a helper class for several RTPTransmitter instances. Typically a call to 'select' (or 'poll' or 'WSAPoll', depending on the platform) is used to wait for incoming data for a certain time. To be able to cancel this wait from another thread, this class provides a socket descriptor that's compatible with e.g. the 'select' call, and to which data can be sent using RTPAbortDescriptors::SendAbortSignal. If the descriptor is included in the 'select' call, the function will detect incoming data and the function stops waiting for incoming data.

The class can be useful in case you'd like to create an implementation which uses a single poll thread for several RTPSession and RTPTransmitter instances. This idea is further illustrated in example8.cpp.

Member Function Documentation

int jrtplib::RTPAbortDescriptors::ClearAbortSignal ( )
void jrtplib::RTPAbortDescriptors::Destroy ( )
SocketType jrtplib::RTPAbortDescriptors::GetAbortSocket ( ) const
inline
int jrtplib::RTPAbortDescriptors::Init ( )
bool jrtplib::RTPAbortDescriptors::IsInitialized ( ) const
inline
int jrtplib::RTPAbortDescriptors::ReadSignallingByte ( )
int jrtplib::RTPAbortDescriptors::SendAbortSignal ( )

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