If running Mono, use a different method to send bytes.

This commit is contained in:
Deathmax 2011-12-17 21:48:40 +08:00
parent cdde472c54
commit 18421ad208

View file

@ -169,7 +169,10 @@ namespace TShockAPI
{
if (socket.tcpClient.Client != null && socket.tcpClient.Client.Poll(0, SelectMode.SelectWrite))
{
socket.tcpClient.Client.Send(buffer, offset, count, SocketFlags.None);
if (Main.runningMono)
socket.networkStream.Write(buffer, offset, count);
else
socket.tcpClient.Client.Send(buffer, offset, count, SocketFlags.None);
return true;
}
}
@ -179,6 +182,9 @@ namespace TShockAPI
catch (SocketException)
{
}
catch (IOException)
{
}
return false;
}