Harden CultNet snapshot fetches
This commit is contained in:
parent
6e000a71a9
commit
81b01ec41e
2 changed files with 54 additions and 1 deletions
|
|
@ -1837,6 +1837,14 @@ namespace GameCult.Networking
|
|||
{
|
||||
return null;
|
||||
}
|
||||
catch (SocketException error) when (
|
||||
error.SocketErrorCode == SocketError.ConnectionReset ||
|
||||
error.SocketErrorCode == SocketError.ConnectionAborted ||
|
||||
error.SocketErrorCode == SocketError.Shutdown)
|
||||
{
|
||||
DisconnectReason = Array.Empty<byte>();
|
||||
return null;
|
||||
}
|
||||
|
||||
_stats.BytesReceived += received;
|
||||
if (_remoteEndPoint == null)
|
||||
|
|
@ -2163,6 +2171,13 @@ namespace GameCult.Networking
|
|||
{
|
||||
return null;
|
||||
}
|
||||
catch (SocketException error) when (
|
||||
error.SocketErrorCode == SocketError.ConnectionReset ||
|
||||
error.SocketErrorCode == SocketError.ConnectionAborted ||
|
||||
error.SocketErrorCode == SocketError.Shutdown)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
_stats.BytesReceived += received;
|
||||
var wire = new byte[received];
|
||||
|
|
|
|||
Loading…
Reference in a new issue