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,6 +169,9 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
if (socket.tcpClient.Client != null && socket.tcpClient.Client.Poll(0, SelectMode.SelectWrite))
|
if (socket.tcpClient.Client != null && socket.tcpClient.Client.Poll(0, SelectMode.SelectWrite))
|
||||||
{
|
{
|
||||||
|
if (Main.runningMono)
|
||||||
|
socket.networkStream.Write(buffer, offset, count);
|
||||||
|
else
|
||||||
socket.tcpClient.Client.Send(buffer, offset, count, SocketFlags.None);
|
socket.tcpClient.Client.Send(buffer, offset, count, SocketFlags.None);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -179,6 +182,9 @@ namespace TShockAPI
|
||||||
catch (SocketException)
|
catch (SocketException)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
catch (IOException)
|
||||||
|
{
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue