How to Hoops Websocket maintain connect


I am a person who is testing to develop using Hoops.

Currently, after opening the viewer service (web screen) of hoops, after a certain period of time without any work, the websocket connection with the viewer is disconnected and the process dies.

As stated in the hoops guide Even if I change the spawnInitialUseDuration of server-config.js to 1800 seconds, 900 seconds, etc., the connection is disconnected in about 15 minutes without any change.

I want the viewer process not to die while the viewer is turned on and maintained no matter how much time elapses (at least 1 hour or more).

Can you tell if you can make any changes in the server-config information in hoops to prevent the viewer process from killing for more than an hour?

Development environment
-windows 10
-using’quick start’ example in hoops communicator.(./

please answer about my question.

Thank you.

Hello, and thanks for reaching out.

I believe the disconnect is actually originating from the client side web viewer and not from the server setup. While on the right track, the duration you are specifying in the server settings is actually the maximum time the server will stay running without establishing a websocket connection with the WebViewer. Once it establishes a websocket connection and receives data from the WebViewer, this value becomes irrelevant for the session.

In the client API, there is a setClientTimeout API to specify how long you would like the session to stay open. It defaults to 15 minutes, which is what you are seeing in your timeout. Feel free to use this API (a method of the WebViewer class) to specify a timeout for your session.

Thank you and good luck!

1 Like