|
@@ -64,7 +64,8 @@ namespace MQTTnet.Implementations |
|
|
|
|
|
|
|
|
if (_options.TlsOptions?.UseTls != true) |
|
|
if (_options.TlsOptions?.UseTls != true) |
|
|
{ |
|
|
{ |
|
|
await _socket.ConnectAsync(new HostName(_options.Server), _options.GetPort().ToString()); |
|
|
|
|
|
|
|
|
var asyncAction = _socket.ConnectAsync(new HostName(_options.Server), _options.GetPort().ToString()); |
|
|
|
|
|
await asyncAction; |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
@@ -85,7 +86,8 @@ namespace MQTTnet.Implementations |
|
|
socketProtectionLevel = SocketProtectionLevel.Tls10; |
|
|
socketProtectionLevel = SocketProtectionLevel.Tls10; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
await _socket.ConnectAsync(new HostName(_options.Server), _options.GetPort().ToString(), socketProtectionLevel); |
|
|
|
|
|
|
|
|
var asyncAction = _socket.ConnectAsync(new HostName(_options.Server), _options.GetPort().ToString(), socketProtectionLevel); |
|
|
|
|
|
await asyncAction; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Endpoint = _socket.Information.RemoteAddress + ":" + _socket.Information.RemotePort; |
|
|
Endpoint = _socket.Information.RemoteAddress + ":" + _socket.Information.RemotePort; |
|
|