diff --git a/src/libnpsharp/NP/NPServer.cs b/src/libnpsharp/NP/NPServer.cs index 751e61e..014995b 100644 --- a/src/libnpsharp/NP/NPServer.cs +++ b/src/libnpsharp/NP/NPServer.cs @@ -31,7 +31,13 @@ namespace NPSharp.NP _log = LogManager.GetLogger("NPServer"); _clients = new List(); - _socket = new Socket(SocketType.Stream, ProtocolType.IP); + // Mono can't compile this since the constructor is proprietary to Windows' .NET library + //_socket = new Socket(SocketType.Stream, ProtocolType.IP); + + // Instead we will specifically disable the socket's property to ignore IPv4 + _socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp); + _socket.SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.IPv6Only, 0); + _port = port; }