[Live-devel] I want to get disconnect event triggered from RTSP server.

Steve Ha steveha at u2sr.com
Fri Mar 27 02:18:58 PDT 2020


Hi Ross,


> *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.*
>
I had installed ByeHandler in RTSP client long time ago but I have never
seen it called back.
You have just reminded me, I check RTCP BYE message at RTSPServer and see
that there are two
possible places which sendBYE() can be invoked when the server closes a
client session/connection but no place
gets effect.

The first place:
void StreamState::endPlaying() {
    // sendBYE() is commented by you.
}

The second place:
RTCPInstance::~RTCPInstance() {
   ...
   sendBYE();

  // Calling sendBYE() at this place is too late because all sockets are
closed.
  // therefore, "BYE" message is never sent to clients.
}


>
> * 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.)*
>

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
disconnected.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20200327/4238b3cd/attachment.htm>


More information about the live-devel mailing list