Commits

Anonymous committed 996bc5a Draft

Net.Serve.OutputSender can handle impolite disconnects

Comments (0)

Files changed (2)

Cineraria.Net.Serve/InputListener.cs

         /// <param name="socket">The socket.</param>
         private void ReactToSocket(Socket socket)
         {
+            RemoteClient conn = this._connections[socket];
             this._connections.Remove(socket);
-            RemoteClient conn = this._connections[socket];
             string message;
             try
             {

Cineraria.Net.Serve/OutputSender.cs

                 }
                 else
                 {
-                    msg.RemoteClient.TcpConnection.Writer.Write(msg.Message);
+                    try
+                    {
+                        msg.RemoteClient.TcpConnection.Writer.Write(msg.Message);
+                    }
+                    catch (System.IO.IOException)
+                    {
+                        continue;
+                    }
                 }
             }
         }