NewLife.MQTT icon indicating copy to clipboard operation
NewLife.MQTT copied to clipboard

最新版本客户端无法连接服务器

Open aprilyush opened this issue 1 year ago • 1 comments

升级到最新版本后 客户端无法连接服务器 ` static async Task Main(string[] args) { Console.WriteLine("Hello, World!");

XTrace.UseConsole();
try
{
  
    var mqttClient = new MqttClient
    {
        Log = XTrace.Log,
        Server = $"tcp://127.0.0.1:1883",
        UserName = "fofia",
        Password = "123123",
        ClientId = "fofia_client_faker111",
        Reconnect = true,
        KeepAlive = 30
    };

    var ack =await mqttClient.ConnectAsync();
    if (ack.ReturnCode == ConnectReturnCode.Accepted)
    {
        XTrace.WriteLine("MQTT已连接");

    }
}
catch (Exception ex)
{
    XTrace.WriteException(ex);
}
Console.ReadKey();

} ` 报错:A task was canceled. 微信截图_20241120151502

aprilyush avatar Nov 20 '24 07:11 aprilyush

拉取新代码试一下

nnhy avatar Dec 16 '24 02:12 nnhy

新版测试通过,可能是中间某个版本有bug

nnhy avatar May 15 '25 14:05 nnhy