<html><head><base href="x-msg://2410/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="EN-US" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">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?</div></div></div></span></blockquote><br></div><div>OK, here are the steps to take (in order):</div><div><br></div><div>1/ Close each of the 'sink' objects. You can do this as follows (assuming that you have "session": a pointer to a "MediaSession" object):</div><div><br></div><div><div>if (session != NULL) {</div><div> MediaSubsessionIterator iter(*session);</div><div> MediaSubsession* subsession;</div><div> while ((subsession = iter.next()) != NULL) {</div><div> Medium::close(subsession->sink);</div><div> }</div><div>}</div></div><br><div>2/ Close the "MediaSession" object (and all of the "RTPSource" and "RTCPInstance" objects that it created):</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Medium::close(session);</div><div><br></div><div>3/ Close the "RTSPClient" object:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Medium::close(rtspClient);</div><br><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/">http://www.live555.com/</a></span></span>
</div>
<br></body></html>