The article teaches how to determine session connection status.
The getConnectionStatus method lets you determine the current status of your session.
getConnectionStatus Hide
typescriptjavascriptsession.getConnectionStatus().isConnected()
This method returns a boolean value that shows whether the session is connected or not. The connection status can be one of four values, each with a matching method:
1. isConnected(): returns true if the session is connected to the server.
2. isConnecting(): returns true if the session is attempting to connect to the server.
3. isDisconnected(): returns true if the session is disconnected from the server.
4. isDisconnecting(): returns true if the session is terminating the connection to the server.
You can also track any changes in the connection status by using the IConnectionStatusChangeListener interface and adding it to the session.
For more information, refer to the article Execute a command.