class RTCPAbstractServer

RTCP abstract server. More...

Contains pure virtuals
Full nameCoral::RTCPAbstractServer
Definition#include <rtcpabstractserver.h>
InheritsCoral::TimedThread
Inherited byTraceServer
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods


Detailed Description

This class is an abstract RTCP server.

Client (struct)

Client structure with information on the client.

 RTCPAbstractServer ()

Constructor.

RTCPAbstractServer ()

Destructor.

void*  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.

enum DeleteReason {DeleteReason_UserBye = 0, DeleteReason_Timeout = 1, DeleteReason_Shutdown = 2, DeleteReason_Error = 3, }

A set of reasons for deleteClient() call.

void  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.

bool  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.

void  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.

void  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.

void  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.

void  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.

inline cardinal  getMembers ()

Get number of members serverd by the server.

Returns: Number of members.

inline card64  getDefaultTimeout ()

[const]

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

Returns: Default timeout in microseconds.

inline void  setDefaultTimeout (const card64 timeout)

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  stop ()

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

Reimplemented from TimedThread.