class RTP_SessionManager

This class is for encpsulating the IETF Real Time Protocol interface

Inheritance:


Public Methods

[more] Construction
[more] Operations


Documentation

This class is for encpsulating the IETF Real Time Protocol interface
o Construction

o RTP_SessionManager()
Construct new session manager database

o Operations

oRTP_Session* UseSession( unsigned sessionID )
Use an RTP session for the specified ID.

If this function returns a non-null value, then the ReleaseSession() function MUST be called or the session is never deleted for the lifetime of the session manager.

If there is no session of the specified ID, then you MUST call the AddSession() function with a new RTP_Session. The mutex flag is left locked in this case. The AddSession() expects the mutex to be locked and unlocks it automatically.

Parameters:
sessionID - Session ID to use.

ovoid AddSession( RTP_Session* session )
Add an RTP session for the specified ID.

This function MUST be called only after the UseSession() function has returned NULL. The mutex flag is left locked in that case. This function expects the mutex to be locked and unlocks it automatically.

Parameters:
session - Session to add.

ovoid ReleaseSession( unsigned sessionID )
Release the session. If the session ID is not being used any more any clients via the UseSession() function, then the session is deleted.
Parameters:
sessionID - Session ID to release.

oRTP_Session* GetSession( unsigned sessionID ) const
Get a session for the specified ID. Unlike UseSession, this does not increment the usage count on the session so may be used to just gain a pointer to an RTP session.
Parameters:
sessionID - Session ID to get.

oRTP_Session* First()
Begin an enumeration of the RTP sessions. This function acquires the mutex for the sessions database and returns the first element in it.

eg: RTP_Session * session; for (session = rtpSessions.First(); session != NULL; session = rtpSessions.Next()) { if (session->Something()) { rtpSessions.Exit(); break; } }

Note that the Exit() function must be called if the enumeration is stopped prior to Next() returning NULL.

oRTP_Session* Next()
Get the next session in the enumeration. The session database remains locked until this function returns NULL.

Note that the Exit() function must be called if the enumeration is stopped prior to Next() returning NULL.

ovoid Exit()
Exit the enumeration of RTP sessions. If the enumeration is desired to be exited before Next() returns NULL this this must be called to unlock the session database.

Note that you should NOT call Exit() if Next() HAS returned NULL, or race conditions can result.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.