lexonegit / Unity-Twitch-Chat

Lightweight and easy-to-use Twitch IRC client for Unity (C#)
Other
122 stars 24 forks source link

StreamReader.ReadLine() randomly fails (System.IO.IOException) #1

Closed lexonegit closed 1 year ago

lexonegit commented 3 years ago

When connecting to the IRC, StreamReader.ReadLine() can sometimes fail causing the connection to break. Not sure why it happens. Right now the issue is solved by simply just reconnecting whenever it happens.

You can try reproducing the bug by repeatedly connecting and disconnecting. It's kind of random.

You should also modify TwitchIRC.cs (line 154) to look something like this, so you can actually see the error code.

try { raw = reader.ReadLine(); }
catch (System.Exception e) 
{
  Debug.LogError(e);

  // other code...
}
lexonegit commented 1 year ago

Fixed