Skip to content

Commit

Permalink
[fix] Socket.OSSupportsIPv6 不支持Xamarin.Android。fix #115
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Mar 25, 2024
1 parent d622277 commit abd96aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion NewLife.Core/Net/NetServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,8 @@ protected ISocketServer[] CreateServer(IPAddress address, Int32 port, NetType pr
// 兼容Linux
//if (Socket.OSSupportsIPv4)
list.AddRange(CreateServer<TServer>(address, port, AddressFamily.InterNetwork));
if (Socket.OSSupportsIPv6) list.AddRange(CreateServer<TServer>(address, port, AddressFamily.InterNetworkV6));
if (Socket.OSSupportsIPv6 && !Runtime.Mono)
list.AddRange(CreateServer<TServer>(address, port, AddressFamily.InterNetworkV6));
break;
}

Expand Down

0 comments on commit abd96aa

Please sign in to comment.