Added comment to mono compatibility fix

This commit is contained in:
MaxXor 2016-07-18 20:27:50 +02:00
parent 3c01a99aff
commit ef1a51ef1b
2 changed files with 4 additions and 2 deletions

View File

@ -256,7 +256,9 @@ namespace xServer.Core.Networking
if (Socket.OSSupportsIPv6 && ipv6)
{
_handle = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);
_handle.SetSocketOption(SocketOptionLevel.IPv6, (SocketOptionName)27, 0);
// fix for mono compatibility, SocketOptionName.IPv6Only
SocketOptionName ipv6only = (SocketOptionName)27;
_handle.SetSocketOption(SocketOptionLevel.IPv6, ipv6only, 0);
_handle.Bind(new IPEndPoint(IPAddress.IPv6Any, port));
}
else