RTP Audio System
2.0.0
|
RTCP abstract server. More...
#include <rtcpabstractserver.h>
Classes | |
struct | Client |
Public Types | |
enum | DeleteReason { DeleteReason_UserBye = 0, DeleteReason_Timeout = 1, DeleteReason_Shutdown = 2, DeleteReason_Error = 3 } |
Public Member Functions | |
RTCPAbstractServer () | |
~RTCPAbstractServer () | |
virtual void * | newClient (Client *client, const char *cname)=0 |
virtual void | deleteClient (Client *client, const DeleteReason reason)=0 |
virtual bool | checkClient (Client *client)=0 |
virtual void | appMessage (Client *client, const char *name, void *data, const cardinal dataLength)=0 |
virtual void | sdesMessage (Client *client, const card8 type, char *data, const cardinal length)=0 |
virtual void | receiverReport (Client *client, RTCPReceptionReportBlock *report, const cardinal layer)=0 |
virtual void | outOfMemoryWarning () |
cardinal | getMembers () |
card64 | getDefaultTimeout () const |
void | setDefaultTimeout (const card64 timeout) |
void * | stop () |
Private Member Functions | |
void | receivedSenderReport (const InternetFlow flow, const card32 source, RTCPReceptionReportBlock *report, const cardinal layer) |
void | receivedReceiverReport (const InternetFlow flow, const card32 source, RTCPReceptionReportBlock *report, const cardinal layer) |
void | receivedSourceDescription (const InternetFlow flow, const card32 source, const card8 type, char *data, const card8 length) |
void | receivedApp (const InternetFlow flow, const card32 source, const char *name, void *data, const card32 dataLength) |
void | receivedBye (const InternetFlow flow, const card32 source, const DeleteReason reason) |
Client * | findClient (const card32 source, const InternetFlow flow) |
void | timerEvent () |
Private Attributes | |
card64 | DefaultTimeout |
std::multimap< const cardinal, Client * > | ClientSet |
Friends | |
class | RTCPReceiver |
RTCP abstract server.
This class is an abstract RTCP server.
A set of reasons for deleteClient() call.
Constructor.
Destructor.
virtual void RTCPAbstractServer::appMessage | ( | Client * | client, |
const char * | name, | ||
void * | data, | ||
const cardinal | dataLength | ||
) | [pure virtual] |
Called when a client sends RTCP APP message. The call is synchronized by RTCPAbstractServer.
client | Client. |
name | RTCP APP name. |
data | RTCP APP data. |
dataLength | RTCP APP data length. |
Implemented in AudioServer.
virtual bool RTCPAbstractServer::checkClient | ( | Client * | client | ) | [pure virtual] |
This method is called about once per second to check, if the client is okay (e.g. no transmission error has occurred etc.) The call is synchronized by RTCPAbstractServer.
Implemented in AudioServer.
virtual void RTCPAbstractServer::deleteClient | ( | Client * | client, |
const DeleteReason | reason | ||
) | [pure virtual] |
Called when a client sends RTCP BYE or the timeout is reached. The call is synchronized by RTCPAbstractServer.
client | Client. |
reason | Reason for deleteClient() call. |
hasTimeout | true, if timeout is reached; false, if RTCP BYE received. |
shutdown | true, if server shutdown is in progress. |
Implemented in AudioServer.
RTCPAbstractServer::Client * RTCPAbstractServer::findClient | ( | const card32 | source, |
const InternetFlow | flow | ||
) | [private] |
card64 RTCPAbstractServer::getDefaultTimeout | ( | ) | const [inline] |
Get the default timeout in microseconds, after which a client is assumed to be dead and removed.
cardinal RTCPAbstractServer::getMembers | ( | ) | [inline] |
Get number of members serverd by the server.
virtual void* RTCPAbstractServer::newClient | ( | Client * | client, |
const char * | cname | ||
) | [pure virtual] |
Called when a new client sends its SDES CNAME message. The class inheriting RTCPAbstractServer may use the client->UserData field to store additional data to serve the client. The result of the call will be saved into this field (client->UserData = newClient(client))! The call is synchronized by RTCPAbstractServer.
client | Client. |
cname | CNAME string. |
Implemented in AudioServer.
void RTCPAbstractServer::outOfMemoryWarning | ( | ) | [virtual] |
This method is called, if an out of memory error occurs. It prints a simple error message. It should be overloaded by a more useful method within the concrete server. The call is synchronized by RTCPAbstractServer.
Reimplemented in AudioServer.
void RTCPAbstractServer::receivedApp | ( | const InternetFlow | flow, |
const card32 | source, | ||
const char * | name, | ||
void * | data, | ||
const card32 | dataLength | ||
) | [private] |
void RTCPAbstractServer::receivedBye | ( | const InternetFlow | flow, |
const card32 | source, | ||
const DeleteReason | reason | ||
) | [private] |
void RTCPAbstractServer::receivedReceiverReport | ( | const InternetFlow | flow, |
const card32 | source, | ||
RTCPReceptionReportBlock * | report, | ||
const cardinal | layer | ||
) | [private] |
void RTCPAbstractServer::receivedSenderReport | ( | const InternetFlow | flow, |
const card32 | source, | ||
RTCPReceptionReportBlock * | report, | ||
const cardinal | layer | ||
) | [private] |
void RTCPAbstractServer::receivedSourceDescription | ( | const InternetFlow | flow, |
const card32 | source, | ||
const card8 | type, | ||
char * | data, | ||
const card8 | length | ||
) | [private] |
virtual void RTCPAbstractServer::receiverReport | ( | Client * | client, |
RTCPReceptionReportBlock * | report, | ||
const cardinal | layer | ||
) | [pure virtual] |
Called when a client sends a receiver report; it is called for every receiver report block in the message. The call is synchronized by RTCPAbstractServer.
client | Client. |
report | RTCPReceptionReportBlock. |
layer | Layer number. |
Implemented in AudioServer.
virtual void RTCPAbstractServer::sdesMessage | ( | Client * | client, |
const card8 | type, | ||
char * | data, | ||
const cardinal | length | ||
) | [pure virtual] |
Called when a client sends RTCP SDES message; it is called for every SDES item in the message. The call is synchronized by RTCPAbstractServer.
client | Client. |
type | RTCP SDES type. |
data | RTCP SDES data. |
length | RTCP SDES length. |
Implemented in AudioServer.
void RTCPAbstractServer::setDefaultTimeout | ( | const card64 | timeout | ) | [inline] |
Set the default timeout in microseconds, after which a client is assumed to be dead and removed. The new value will be used for all new clients. Timeouts of old clients are not changed!
timeout | Default timeout in microseconds. |
void * RTCPAbstractServer::stop | ( | ) | [virtual] |
Reimplementation of Thread::stop() to remove all clients before stopping.
Reimplemented from MultiTimerThread< Timers >.
void RTCPAbstractServer::timerEvent | ( | ) | [private, virtual] |
The virtual timerEvent() method, which contains the timed thread's implementation. It has to be implemented by classes, which inherit TimedThread. This method is called regularly with the given interval.
Implements TimedThread.
friend class RTCPReceiver [friend] |
RTCPReceiver is friend class to enable usage of receivedXXX() methods.
std::multimap<const cardinal,Client*> RTCPAbstractServer::ClientSet [private] |
card64 RTCPAbstractServer::DefaultTimeout [private] |