缺少IOT Hub C#DeviceClient消息

时间:2020-01-07 18:37:59

标签: azure mqtt azure-iot-hub

这看起来很奇怪,但是看来使用C#设备客户端发送的消息没有在集线器上收到,但没有exeotuib客户端吗?

我不确定这是否完全可能。一切对于Android设备而言都是完美的,但是在Windows设备上,我们会像这样发送:

mHost.LogInFile(string.Format("SendEventAsync(): going to send {0}", path));
            Task.Run(async () =>
            {
                try
                {
                    var task = mClient.SendEventAsync(eventMessage, cancellationTokenSource.Token);
                    if (await Task.WhenAny(task, Task.Delay(mSendTimeout)) == task)
                    {
                        mHost.LogInFile(string.Format("SendFile({0}) finished.", path));
                        mHost.MoveFile(path, ConfigWrapper.Config.Sent);
                    }
                    else
                    {
                        mHost.LogInFile(string.Format("SendFile() timeout {0} reached.", mSendTimeout));
                    }
                }
                catch (Exception ex)
                {
                    mHost.LogInFile(string.Format("SendEventAsync() has thrown an exception {0}", ex.ToString()));
                }
            }
            );

在android上,我们确实具有消息状态的回调,但是在C#上,我们只能希望消息已传递?

谢谢!

0 个答案:

没有答案