[Live-devel] RTSPClientSession and doEventLoop in a dynamic server

Rawling, Stuart SRawling at pelco.com
Wed Sep 2 17:33:26 PDT 2009


Hi,

My implementation of a dynamic RTSPServer works as follows:  When a request
is received, the subclasses RTSPServer instance has an overloaded
lookupServerMediaSession function.   If the stream is not already present on
the server, it will bootstrap the stream and add to the server before
returning the correct ServerMediaSession object.

The bootstrap process can sometimes take a long time, and so in order to not
interrupt the operation of the other streams, I spawn a NON-LIVE555 thread
to perform the actual bootstrap whilst the live555 runs an additional
doEventLoop(watchVar).  When the thread completes, it signals the watchVar
and the stream is then added to the server if the bootstrapping is
successful.   Then the main live555 thread continues.

The consequence is that within a ³doEventLoop² call there is an additional
³doEventLoop² being ran.  One of the problems I have seen is that sometimes
whilst the bootstrapping is happening, the client closes the connection.  In
the second ³doEventLoop² the server recognizes this and deletes the
RTSPClientSession object.  Unfortunately, it is this within this object that
is performing the second doEventLoop (in the handleCmd_DESCRIBE function),
and things obviously start to go awry.

One solution is to handle this by reference counting the incoming
connections on the my custom RTSPClientSession.  However, the only place to
handle this would be the incomingRequestHandler, however this function is
not virtual in the RTSPClientSession.

Another solution would be to turn off backgroundReadHandling whilst
performing a DESCRIBE.  Then turn it on again after the DESCRIBE is
complete.  This does not seem a general purpose solution tho, as what if I
have another function where doEventLoop is called.

At this point I would welcome feedback.  Am I handling this case all wrong?

Regards,
Stuart



- ------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this transmission is legally privileged and confidential, intended only for the use of the individual(s) or entities named above. This email and any files transmitted with it are the property of Pelco. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any review, disclosure, copying, distribution, retention, or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. If you receive this communication in error, please notify us immediately by telephone call to +1-559-292-1981 or forward the e-mail to administrator at pelco.com and then permanently delete the e-mail and destroy all soft and hard copies of the message and any attachments. Thank you for your cooperation. 
- ------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20090902/be7a4888/attachment.html>


More information about the live-devel mailing list