jchristn/WatsonWebsocket

Cannot detect if connexion failed

Closed this issue · 1 comments

Hello !
I'm happy to use Watson WebSocket, thnak for the good job.
If I kill the webSocketService and try to Start my Client, I don't have error or exception.
How Can I detect when client cannot connect to webSocket ?
Thanks you.

Hi @Taliesin60 thanks for your note. Moving this to a discussion.

The Test.Client project gives an example of how to do this. After calling .Start() on the client, check the .Connected property (Boolean).

C:\Code\Watson\WatsonWebsocket-4.0\src\Test.Client\bin\Debug\net7.0>test.client
Server IP: [localhost]
Server port: [9000]
Use SSL: [y/N]?
Client connected: False