Discussion:
[Live-devel] How do I gracefully disconnect all clients?
j***@jaredrobinson.com
2018-08-28 23:18:23 UTC
Permalink
Hello,

I'm brand new to live555, so maybe this is a dumb question, but how can
I gracefully disconnect all connected clients, without shutting down the
server?

I want to do this when I change the password so that clients will get
disconnected and then they'll reconnect using the new password.

From my subclass, I can't call GenericMediaServer.cleanup() because it
is private, and that's probably not really what I want anyway.

I can't iterate over GenericMediaServer->fOurServerMediaSession and call
closeAllClientSessionsForServerMediaSession(session), because
fOurServerMediaSession is private.

Thanks,

Jared
Ross Finlayson
2018-08-28 23:37:11 UTC
Permalink
Post by j***@jaredrobinson.com
Hello,
I'm brand new to live555, so maybe this is a dumb question, but how can I gracefully disconnect all connected clients, without shutting down the server?
You call “GenericMediaServer::closeAllClientSessionsForServerMediaSession()”; see “liveMedia/include/GenericMediaServer.hh"; lines 55-59.

If you want to do this for *all* of the server’s “ServerMediaSession” objects, rather than just one, then you’d create a “ServerMediaSessionIterator”, to iterate over all of the “ServerMediaSession” objects, and call "closeAllClientSessionsForServerMediaSession()” on each one.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
j***@jaredrobinson.com
2018-08-30 22:30:18 UTC
Permalink
Thanks. Using the iterator worked.
Post by Ross Finlayson
You call
“GenericMediaServer::closeAllClientSessionsForServerMediaSession()”;
see “liveMedia/include/GenericMediaServer.hh"; lines 55-59.
If you want to do this for *all* of the server’s “ServerMediaSession”
objects, rather than just one, then you’d create a
“ServerMediaSessionIterator”, to iterate over all of the
“ServerMediaSession” objects, and call
"closeAllClientSessionsForServerMediaSession()” on each one.
Loading...