Skip to content

Commit

Permalink
Import changes from version 4
Browse files Browse the repository at this point in the history
  • Loading branch information
chkr1011 committed May 19, 2024
1 parent 111c11a commit dc472d7
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions Source/MQTTnet/Client/Options/MqttClientOptionsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,16 +297,7 @@ public MqttClientOptionsBuilder WithTcpServer(string host, int? port = null, Add

// The value 0 will be updated when building the options.
// This a backward compatibility feature.

if (IPAddress.TryParse(host, out var ipAddress))
{
_remoteEndPoint = new IPEndPoint(ipAddress, port ?? 0);
}
else
{
_remoteEndPoint = new DnsEndPoint(host, port ?? 0, addressFamily);
}

_remoteEndPoint = new DnsEndPoint(host, port ?? 0, addressFamily);
_port = port;

return this;
Expand Down

0 comments on commit dc472d7

Please sign in to comment.