[Live-devel] Force disconnection from server side

Ross Finlayson finlayson at live555.com
Thu May 23 15:58:51 PDT 2024



> On May 23, 2024, at 1:26 PM, Flavio Alves <flavio.alves at vitalintelligencedata.com> wrote:
> 
> Hello,
> 
> I am working on an RTSP server application with streaming sourced by a DeviceSource component.
> 
> So far, everything is fine. But the source, as an external device, can be unplugged from the CPU. In this case, the source signal is lost.
> 
> When this happens, I would like the server to stop the communication with the client. Is it possible? What would be the best approach to do that?

You can call the function
	GenericMediaServer::closeAllClientSessionsForServerMediaSession()
on your RTSP server.  You can pass as parameter either (a pointer to) the “ServerMediaSession” object, or the character-string stream name.

If you have more than one “ServerMediaSession” in your server, then you can iterate over them, and call “closeAllClientSessionsForServerMediaSession()” on each one.


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




More information about the live-devel mailing list