RTP Trace System
1.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 (const Client *client)=0 |
virtual void | appMessage (const Client *client, const char *name, const void *data, const cardinal dataLength)=0 |
virtual void | sdesMessage (const Client *client, const card8 type, const char *data, const cardinal length)=0 |
virtual void | receiverReport (const Client *client, const 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, const RTCPReceptionReportBlock *report, const cardinal layer) |
void | receivedReceiverReport (const InternetFlow flow, const card32 source, const RTCPReceptionReportBlock *report, const cardinal layer) |
void | receivedSourceDescription (const InternetFlow flow, const card32 source, const card8 type, const char *data, const card8 length) |
void | receivedApp (const InternetFlow flow, const card32 source, const char *name, const 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 |
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 Coral::RTCPAbstractServer::appMessage | ( | const Client * | client, |
const char * | name, | ||
const 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 Coral::TraceServer.
virtual bool Coral::RTCPAbstractServer::checkClient | ( | const 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 Coral::TraceServer.
virtual void Coral::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 Coral::TraceServer.
RTCPAbstractServer::Client * Coral::RTCPAbstractServer::findClient | ( | const card32 | source, |
const InternetFlow | flow | ||
) | [private] |
card64 Coral::RTCPAbstractServer::getDefaultTimeout | ( | ) | const [inline] |
Get the default timeout in microseconds, after which a client is assumed to be dead and removed.
cardinal Coral::RTCPAbstractServer::getMembers | ( | ) | [inline] |
Get number of members serverd by the server.
virtual void* Coral::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 Coral::TraceServer.
void Coral::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 Coral::TraceServer.
void Coral::RTCPAbstractServer::receivedApp | ( | const InternetFlow | flow, |
const card32 | source, | ||
const char * | name, | ||
const void * | data, | ||
const card32 | dataLength | ||
) | [private] |
void Coral::RTCPAbstractServer::receivedBye | ( | const InternetFlow | flow, |
const card32 | source, | ||
const DeleteReason | reason | ||
) | [private] |
void Coral::RTCPAbstractServer::receivedReceiverReport | ( | const InternetFlow | flow, |
const card32 | source, | ||
const RTCPReceptionReportBlock * | report, | ||
const cardinal | layer | ||
) | [private] |
void Coral::RTCPAbstractServer::receivedSenderReport | ( | const InternetFlow | flow, |
const card32 | source, | ||
const RTCPReceptionReportBlock * | report, | ||
const cardinal | layer | ||
) | [private] |
void Coral::RTCPAbstractServer::receivedSourceDescription | ( | const InternetFlow | flow, |
const card32 | source, | ||
const card8 | type, | ||
const char * | data, | ||
const card8 | length | ||
) | [private] |
virtual void Coral::RTCPAbstractServer::receiverReport | ( | const Client * | client, |
const 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 Coral::TraceServer.
virtual void Coral::RTCPAbstractServer::sdesMessage | ( | const Client * | client, |
const card8 | type, | ||
const 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 Coral::TraceServer.
void Coral::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 Coral::RTCPAbstractServer::stop | ( | ) | [virtual] |
Reimplementation of Thread::stop() to remove all clients before stopping.
Reimplemented from Coral::TimedThread.
void Coral::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 Coral::TimedThread.
friend class RTCPReceiver [friend] |
RTCPReceiver is friend class to enable usage of receivedXXX() methods.
multimap<const cardinal,Client*> Coral::RTCPAbstractServer::ClientSet [private] |