Skip to content

How to retrieve current connected state? #68

Answered by onyx-and-iris
G4PLS asked this question in Q&A
Discussion options

You must be logged in to vote

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 JSONDecodeError on 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.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by onyx-and-iris
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #48 on July 10, 2025 21:30.