Merge pull request #524 from Olink/general-devel

Add in error ignore for the socket exception in the packet bufferer.
This commit is contained in:
Lucas Nicodemus 2013-09-21 11:19:22 -07:00
commit 07c639d569

View file

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