物联网C SDK消息丢失 [英] IOT C SDK Messages are lost

查看:86
本文介绍了物联网C SDK消息丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用IOT C SDK API进行开发.我使用的协议是HTTP.有时我的程序没有将云传送到设备消息.其间失去.从IOT集线器中,我可以看到它已发送到C2D,但在我的程序中未收到它.谁能帮我 要解决此问题?

I am using IOT C SDK APIs for development. Protocol I am using is HTTP. Sometimes my program is not getting cloud to device messages. Its lost in between. From IOT hub I can see that its sent to C2D but in my program its not received. Can anyone help me to fix this issue?

推荐答案

我建议您阅读以下文章: https ://docs.microsoft.com/zh-CN/azure/iot-hub/iot-hub-devguide-protocols

I would advise that you read the following article: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-protocols

并特别注意以下几点:

" . HTTPS没有有效的方法来实现服务器推送.因此,当您使用HTTPS时,设备会轮询IoT中心以获取云到设备的消息.对于设备和IoT中心而言,这种方法效率低下.根据当前的HTTPS指南,每个设备都应 每隔25分钟或更长时间轮询一次消息.当接收云到设备的消息时,MQTT和AMQP支持服务器推送.它们可将消息立即从IoT中心推送到设备.如果需要考虑传送延迟,则MQTT或AMQP是最佳协议 使用.对于很少连接的设备,HTTPS也可以使用."

"Cloud-to-device pattern. HTTPS does not have an efficient way to implement server push. As such, when you are using HTTPS, devices poll IoT Hub for cloud-to-device messages. This approach is inefficient for both the device and IoT Hub. Under current HTTPS guidelines, each device should poll for messages every 25 minutes or more. MQTT and AMQP support server push when receiving cloud-to-device messages. They enable immediate pushes of messages from IoT Hub to the device. If delivery latency is a concern, MQTT or AMQP are the best protocols to use. For rarely connected devices, HTTPS works as well."

让我们知道它是否有助于澄清您所看到的某些行为?如果您有特定的错误消息,请与我们分享.

Let us know if it helps clarifying some of the behaviors you are seeing? If you have a specific error message please share it and we can take a look at it.

谢谢!


这篇关于物联网C SDK消息丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆