If running Mono, use a different method to send bytes.
This commit is contained in:
parent
cdde472c54
commit
18421ad208
1 changed files with 7 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue