[Live-devel] Proper destruction of subsessions

Patrick White patbob at imoveinc.com
Mon Jul 20 09:58:38 PDT 2009


Matt & I went though this issue a while back for live streams.  It's probably 
similar if you're trying to shut down a file-based stream before it gets to 
its end...

To force a session to end before the client requests a teardown, we ended up 
deleting the RTSPClientSession instance out from under the session via a 
scheduled task.  That's the way Ross does it in Live555 when a session times 
out, and it is a safe way to terminate a (live) session.

However, when you do that, A BYE doesn't get sent.  Matt chased that end of 
things, and IIRC, he found that the library goes through the motions to send 
the BYE, but then cleans the session up before it can get sent.  You'll have 
to modify the source to make it get sent.  If you're shutting down a file 
stream, you might be able to shut it down and get the BYE sent by somehow 
convincing it that its already at the end.

hope that helps,
patbob




On Thursday 16 July 2009 12:49 pm, Jerry Johns wrote:
> I am aware of the watch variable method and the Medium::close(), but
> closing the ServerMediaSession, or the Subsession does not entail
> sending a BYE to the connected client - the only way I found till now to
> send a BYE is to do a handleClosure() from within my framer source when
> it detects a shutdown of the application. Ultimately, the problem here
> is that I want to ensure BYE is sent, and THEN liveMedia is shut-down
> (i.e, taskScheduler returns) and that this order is obeyed. Having the
> watchVariable is fantastic but currently I have no way to really ensure
> that my handleClosure() triggers the BYE and then the scheduler shuts
> down.
>
> Jerry Johns
> Design Engineer
> Nuvation Research Corp - Canada
> Tel: (519) 746-2304 ext. 221
> www.nuvation.com <http://www.nuvation.com/>


More information about the live-devel mailing list