Add exception handling

This commit is contained in:
high 2011-08-02 17:31:53 -04:00
parent cc907b9e09
commit 9404c078dc

View file

@ -51,7 +51,19 @@ namespace TShockAPI
continue;
byte[] buff = buffers[i].GetBytes(BytesPerUpdate);
Netplay.serverSock[i].networkStream.Write(buff, 0, buff.Length);
if (buff == null)
continue;
try
{
Netplay.serverSock[i].tcpClient.Client.Send(buff);
}
catch (ObjectDisposedException)
{
}
catch (SocketException)
{
}
}
}