|
JRTPLIB
3.11.2 (development version)
|
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. | |
| SocketType | GetAbortSocket () const |
| Returns the socket descriptor that can be included in a call to 'select' (for example). | |
| bool | IsInitialized () const |
| Returns a flag indicating if this instance was initialized. | |
| void | Destroy () |
| De-initializes this instance. | |
| 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. | |
| int | ReadSignallingByte () |
| For each RTPAbortDescriptors::SendAbortSignal function that's called, a call to this function can be made to clear the state again. | |
| 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. | |
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.