jchristn / WatsonWebsocket

A simple C# async websocket server and client for reliable transmission and receipt of data
MIT License
277 stars 53 forks source link

Cannot detect if connexion failed #114

Closed Taliesin60 closed 1 year ago

Taliesin60 commented 1 year ago

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.

jchristn commented 1 year ago

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