Skip to content

Commit

Permalink
default to InterNetworkV6 for socket client
Browse files Browse the repository at this point in the history
  • Loading branch information
kerryjiang committed May 16, 2024
1 parent 9b5279e commit 3831f51
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/SuperSocket.Client/SocketConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ public SocketConnector(IPEndPoint localEndPoint)

protected override async ValueTask<ConnectState> 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
{
Expand Down

0 comments on commit 3831f51

Please sign in to comment.