fix (one) crash on connection drop

This commit is contained in:
Chris Forbes
2010-05-05 18:18:16 +12:00
parent 9302440613
commit f084f6d446

View File

@@ -135,10 +135,16 @@ namespace OpenRA.Network
{
base.Send( packet );
var ms = new MemoryStream();
ms.Write( BitConverter.GetBytes( (int)packet.Length ) );
ms.Write( packet );
ms.WriteTo( socket.GetStream() );
try
{
var ms = new MemoryStream();
ms.Write(BitConverter.GetBytes((int)packet.Length));
ms.Write(packet);
ms.WriteTo(socket.GetStream());
}
catch (SocketException) { /* drop this on the floor; we'll pick up the disconnect from the reader thread */ }
}
}