<div dir="ltr"><div>Hi Ross,</div><div><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><i>The way to do this is to look for, and handle, a RTCP “BYE” packet that the server should send when it ends the stream. And the way to do that is to call “setByeHandler()” or “setByeWithReasonHandler()” on the “RTCPInstance” object.<br></i>
<br>
</blockquote>I had installed ByeHandler in RTSP client long time ago but I have never seen it called back.<br>You have just reminded me, I check RTCP BYE message at RTSPServer and see that there are two <br>possible places which sendBYE() can be invoked when the server closes a client session/connection but no place<br>gets effect.</div><div class="gmail_quote"><br>The first place:<br>void StreamState::endPlaying() {<br> // sendBYE() is commented by you.<br>}<br><br>The second place:<br>RTCPInstance::~RTCPInstance() {<br> ...<br> sendBYE();<br> <br> // Calling sendBYE() at this place is too late because all sockets are closed.<br> // therefore, "BYE" message is never sent to clients.<br><div>}</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<i><br>
No, you’re ‘barking up the wrong tree’ here. All that is doing is detecting when the RTSP TCP connection has ended. And that can happen at any time during the stream - not necessarily when the stream ends. (It is perfectly legal for a RTSP server to close the RTSP TCP connection at any time - even while the RTP stream is ongoing. Should that happen, our “RTSPClient” code would recover from this automatically; it is of no concern to application code.)</i><br></blockquote><div><br></div><div>Yes, that is exact what I want to handle. In many times video stream in my app is stopped,
I want to show GUI that the network is </div><div>disconnected.</div><div><br></div></div></div>