lexonegit / Unity-Twitch-Chat

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

TwitchConnection.WriteThread check connection #18

Open lexonegit opened 1 year ago

lexonegit commented 1 year ago

TwitchConnection.WriteThread.cs at line 19: var stream = tcpClient.GetStream();

can sometimes give this error: InvalidOperationException: The operation is not allowed on non-connected sockets.

Very random, impossible to reproduce. But maybe add something to verify that TCPClient is actually connected before doing anything.

(issue probably exists in TwitchConnection.ReadThread.cs too)

lexonegit commented 1 year ago

Update: this issue is related to poor/unstable internet connection. But how to handle this?