Answer the question
In order to leave comments, you need to log in
WebSocketSharp error when the server is disconnected or missing. How to handle the exception?
How to handle an exception if the connection is down or the server doesn't disconnect?
var ws = new WebSocket("ws://localhost/client_websocket")
{
ws.OnOpen += (sender, e) => this.Connected();
ws.OnMessage += (sender, e) => Console.WriteLine(e.Data);
ws.OnError += (sender, e) =>//делаем что-то при ошибке
ws.OnClose += (sender, e) => //делаем что-то при отключении
ws.Connect();
while (true)
{
}
}
Answer the question
In order to leave comments, you need to log in
It was just necessary to turn off log
ws.Log.Output = (LogData data, string path) => { };
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question