Add in error ignore for the socket exception in the packet bufferer.

This commit is contained in:
Zack Piispanen 2013-09-21 12:22:22 -04:00
parent 77e845d340
commit d0ba424cd1

View file

@ -122,24 +122,35 @@ namespace TShockAPI
public bool Flush(ServerSock socket) public bool Flush(ServerSock socket)
{ {
try try
{ {
if (socket == null || !socket.active) if (socket == null || !socket.active)
return false; return false;
if (buffers[socket.whoAmI].Count < 1) if (buffers[socket.whoAmI].Count < 1)
return false; return false;
byte[] buff = buffers[socket.whoAmI].GetBytes(BytesPerUpdate); byte[] buff = buffers[socket.whoAmI].GetBytes(BytesPerUpdate);
if (buff == null) if (buff == null)
return false; return false;
if (SendBytes(socket, buff)) if (SendBytes(socket, buff))
{ {
buffers[socket.whoAmI].Pop(buff.Length); buffers[socket.whoAmI].Pop(buff.Length);
return true; return true;
} }
} }
catch (SocketException e)
{
switch ((uint)e.ErrorCode)
{
case 0x80004005:
break;
default:
Log.ConsoleError(e.ToString());
break;
}
}
catch (Exception e) catch (Exception e)
{ {
Log.ConsoleError(e.ToString()); Log.ConsoleError(e.ToString());