How to retrieve current connected state? #68
|
I was looking at the Code and was wondering if there is any way to retrieve the current state of the connection? |
Replies: 2 comments
|
Hello, there exists an ExitStarted event which fires when OBS is being shut down. You may refer to the events example for usage. As for kicking a websocket session well it seems the ReqClient will throw a I hope that's helpful. |
|
This is very helpfull! |
Hello, there exists an ExitStarted event which fires when OBS is being shut down. You may refer to the events example for usage.
As for kicking a websocket session well it seems the ReqClient will throw a
JSONDecodeErroron the next request attempt, which admittedly could be wrapped in a more useful exception. As for the EventClient, it will just hang since recv() is blocking and simply waiting for the next event. I would suggest you rely on the ExitStarted event if you need your client program to be notified of a shutdown.I hope that's helpful.