瀏覽代碼

Fix hanging issue under UWP.

release/3.x.x
Gen 4 年之前
父節點
當前提交
79d95c8516
共有 1 個檔案被更改,包括 4 行新增2 行删除
  1. +4
    -2
      Source/MQTTnet/Implementations/MqttTcpChannel.Uwp.cs

+ 4
- 2
Source/MQTTnet/Implementations/MqttTcpChannel.Uwp.cs 查看文件

@@ -64,7 +64,8 @@ namespace MQTTnet.Implementations

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
{
@@ -85,7 +86,8 @@ namespace MQTTnet.Implementations
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;


Loading…
取消
儲存