diff --git a/src/SuperSocket.Client/SocketConnector.cs b/src/SuperSocket.Client/SocketConnector.cs index 7457b4be4..b2143e698 100644 --- a/src/SuperSocket.Client/SocketConnector.cs +++ b/src/SuperSocket.Client/SocketConnector.cs @@ -24,7 +24,12 @@ public SocketConnector(IPEndPoint localEndPoint) protected override async ValueTask ConnectAsync(EndPoint remoteEndPoint, ConnectState state, CancellationToken cancellationToken) { - var socket = new Socket(remoteEndPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp); + var addressFamily = remoteEndPoint.AddressFamily; + + if (addressFamily == AddressFamily.Unspecified) + addressFamily = AddressFamily.InterNetworkV6; + + var socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp); try {