|
|
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) |
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:
client | Client. |
cname | CNAME 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) |
Called when a client sends RTCP BYE or the timeout is reached. The call is synchronized by RTCPAbstractServer.
Parameters:
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. |
bool checkClient (const Client* client) |
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) |
Called when a client sends RTCP APP message. The call is synchronized by RTCPAbstractServer.
Parameters:
client | Client. |
name | RTCP APP name. |
data | RTCP APP data. |
dataLength | RTCP APP data length. |
void sdesMessage (const Client* client, const card8 type, const char* data, const cardinal length) |
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:
client | Client. |
type | RTCP SDES type. |
data | RTCP SDES data. |
length | RTCP SDES length. |
void receiverReport (const Client* client, const RTCPReceptionReportBlock* report, const cardinal layer) |
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:
client | Client. |
report | RTCPReceptionReportBlock. |
layer | Layer number. |
void outOfMemoryWarning () |
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 () |
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:
timeout | Default timeout in microseconds. |
void stop () |
Reimplementation of Thread::stop() to remove all clients before stopping.
See also: Thread#stop
Reimplemented from TimedThread