Add exception handling
This commit is contained in:
parent
cc907b9e09
commit
9404c078dc
1 changed files with 13 additions and 1 deletions
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue