You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error:
I encounter the following Error using the WebSocketClient:
After a internet connection loss, the Client try to reconnect to Twitch BUT after the first attempt it will just straight up crash because the .NET ClientWebSocket disposes its inner WebSocket if it couldn't connect to the URL.
In the given code above, every attempt to run OpenPrivateAsync() will lead to create a new Client, but then enters the loop where it stays even if it didn't connected successfully, trying to connect with a disposed inner WebSocket.
Easy Reproduction:
Disconnect your PC from the Internet and run
Possible Solution:
Move line 241 into the while loop
while(!IsConnected&&!Options.ReconnectionPolicy.AreAttemptsComplete()){
Logger?.TraceAction(GetType(),"try to connect");// Always create new client when opening new connectionClient= CreateClient();if(!first){await Task.Delay(Options.ReconnectionPolicy.GetReconnectInterval(), CancellationToken.None);}
The text was updated successfully, but these errors were encountered:
Hampo
added a commit
to Hampo/TwitchLib.Communication
that referenced
this issue
Dec 12, 2023
Error:
I encounter the following Error using the WebSocketClient:
After a internet connection loss, the Client try to reconnect to Twitch BUT after the first attempt it will just straight up crash because the .NET ClientWebSocket disposes its inner WebSocket if it couldn't connect to the URL.
TwitchLib.Communication/src/TwitchLib.Communication/Clients/ClientBase.cs
Lines 241 to 258 in 9f1c618
In the given code above, every attempt to run OpenPrivateAsync() will lead to create a new Client, but then enters the loop where it stays even if it didn't connected successfully, trying to connect with a disposed inner WebSocket.
Easy Reproduction:
Disconnect your PC from the Internet and run
Possible Solution:
Move line 241 into the while loop
The text was updated successfully, but these errors were encountered: