Marfusios / websocket-client

🔧 .NET/C# websocket client library
MIT License
682 stars 126 forks source link

Listen method does not handle exceptions #106

Open apobekiaris opened 2 years ago

apobekiaris commented 2 years ago

let's say ln ln 421 throws an Exception

result = await client.ReceiveAsync(buffer, token);

it will be catched on ln549

Logger.Error(e, L($"Error while listening to websocket stream, error: '{e.Message}'"));

next the method tries to ReconnectSynchronize and assuming we have the same exception the method continues makring the client IsRunning, IsStarted in ln 356 of the StartClient method.

Can you please comment as this flow apparently look buggy to me