Commits

Anonymous committed 363f823 Draft

TcpTextConnection sets _disposed properly and ignores SocketExceptions when
closing

Comments (0)

Files changed (1)

Cineraria.Net/TcpTextConnection.cs

                 {
                     // It's okay if the socket is already closed.
                 }
+                catch (SocketException)
+                {
+                    // If there's a read error we'll forcefully close the
+                    // connection below.
+                }
                 catch (IOException)
                 {
                     // If there's a read error we'll forcefully close the
                     this.Client.Close();
                     this.Writer.Dispose();
                     this.Reader.Dispose();
+                    this._disposed = true;
                 }
             }
         }