RTP Trace System  1.0
Coral::RTCPAbstractServer Class Reference

RTCP abstract server. More...

#include <rtcpabstractserver.h>

Inheritance diagram for Coral::RTCPAbstractServer:
Coral::TimedThread Coral::Thread Coral::Synchronizable Coral::TraceServer

List of all members.

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)
ClientfindClient (const card32 source, const InternetFlow flow)
void timerEvent ()

Private Attributes

card64 DefaultTimeout
multimap< const cardinal,
Client * > 
ClientSet

Friends

class RTCPReceiver

Detailed Description

RTCP abstract server.

This class is an abstract RTCP server.

Author:
Thomas Dreibholz
Version:
1.0

Member Enumeration Documentation

A set of reasons for deleteClient() call.

Enumerator:
DeleteReason_UserBye 
DeleteReason_Timeout 
DeleteReason_Shutdown 
DeleteReason_Error 

Constructor & Destructor Documentation


Member Function Documentation

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.

Parameters:
clientClient.
nameRTCP APP name.
dataRTCP APP data.
dataLengthRTCP 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.

Returns:
true, if client is okay; false to delete client in case of an error.

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.

Parameters:
clientClient.
reasonReason for deleteClient() call.
hasTimeouttrue, if timeout is reached; false, if RTCP BYE received.
shutdowntrue, if server shutdown is in progress.

Implemented in Coral::TraceServer.

Get the default timeout in microseconds, after which a client is assumed to be dead and removed.

Returns:
Default timeout in microseconds.

Get number of members serverd by the server.

Returns:
Number of members.
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.

Parameters:
clientClient.
cnameCNAME string.
Returns:
A value, which RTCPAbstractServer will save to client->UserData.

Implemented in Coral::TraceServer.

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.

Parameters:
clientClient.
reportRTCPReceptionReportBlock.
layerLayer 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.

Parameters:
clientClient.
typeRTCP SDES type.
dataRTCP SDES data.
lengthRTCP 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!

Parameters:
timeoutDefault timeout in microseconds.
void Coral::RTCPAbstractServer::stop ( ) [virtual]

Reimplementation of Thread::stop() to remove all clients before stopping.

See also:
Thread::stop

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.


Friends And Related Function Documentation

friend class RTCPReceiver [friend]

RTCPReceiver is friend class to enable usage of receivedXXX() methods.


Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines