1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-06 10:21:09 +09:00

Removed attempt to disconnect offending connection on ConnectionReset

This commit is contained in:
lidgren
2010-10-27 19:53:10 +00:00
parent 0405ef0cdc
commit 350a603e84

View File

@@ -259,22 +259,11 @@ namespace Lidgren.Network
}
catch (SocketException sx)
{
// no good response to this yet
if (sx.SocketErrorCode == SocketError.ConnectionReset)
{
// connection reset by peer, aka connection forcibly closed aka "ICMP port unreachable"
// we should shut down the connection; but m_senderRemote seemingly cannot be trusted, so which connection should we shut down?!
//LogWarning("Connection reset by peer, seemingly from " + m_senderRemote);
lock (m_connections)
{
if (m_connections.Count + m_handshakes.Count == 1)
{
foreach (var kvp in m_handshakes)
kvp.Value.ExecuteDisconnect("Connection forcibly closed", true);
foreach (var conn in m_connections)
conn.ExecuteDisconnect("Connection forcibly closed", true);
}
}
// So, what to do?
return;
}