[Live-devel] Shutting down RTSPClient

Ross Finlayson finlayson at live555.com
Mon Oct 24 16:50:32 PDT 2011


> I have an application that uses one or more RTSPClients.  I am having difficulties in figuring out the best way to have the client handle a drop of the server.  What is the best way to cleanly shutdown the client when the server is either dies or is no longer reachable?  This is part of a larger application and I can't just shutdown the entire application.  Can anyone help me with this?

OK, here are the steps to take (in order):

1/ Close each of the 'sink' objects.  You can do this as follows (assuming that you have "session": a pointer to a "MediaSession" object):

if (session != NULL) {
  MediaSubsessionIterator iter(*session);
  MediaSubsession* subsession;
  while ((subsession = iter.next()) != NULL) {
    Medium::close(subsession->sink);
  }
}

2/ Close the "MediaSession" object (and all of the "RTPSource" and "RTCPInstance" objects that it created):

	Medium::close(session);

3/ Close the "RTSPClient" object:

	Medium::close(rtspClient);


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20111024/519c09ba/attachment.html>


More information about the live-devel mailing list