MQTT连接消耗的功率更少 [英] MQTT connection consumes less power

查看:139
本文介绍了MQTT连接消耗的功率更少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据称MQTT消耗较少的功率以保持代理与客户端之间的连接打开.我相信应用程序层不需要做任何特殊的事情来保持TCP连接,并且MQTT是应用程序层协议.那么,MQTT在这方面如何即兴发挥呢?

MQTT is claimed to consume less power for keeping the connection open between broker and client. I believe application layer need not do anything special to persist a TCP connection and MQTT is an application layer protocol. So, how does MQTT improvises in this area?

推荐答案

HTTP(S)不会保持连接打开-因此,要获得连续连接的效果",HTTPS客户端必须不断发出轮询请求,每次涉及轮询时,每个过程都涉及创建TCP连接和协商SSL/TLS加密等.

HTTP(S) doesn't keep a connection open - so to get the "effect" of a continuous connection, the HTTPS client has to keep making poll requests, each of which involves creating the TCP connection and negotiating SSL/TLS encryption etc. each time a poll is needed.

相比之下,MQTT在开始时就建立了连接,因此TCP和SSL/TLS开销成本仅支付一次. MQTT在TCP连接的顶部在应用程序之间流动着一条保持活动的消息,以便应用程序可以检测到连接断开的时间,这使MQTT代理可以在连接断开时可靠地发布(可选)客户机的最后遗嘱/遗嘱.

By contrast, MQTT makes a connection at the start, so the TCP and SSL/TLS overhead cost is only paid once. MQTT has a keep alive message flowing between applications on top of the TCP connection, so that the applications can detect when the connection is broken, this allows the MQTT broker to reliably publish the (optional) client last will/testament when the connection is broken.

您阅读的文章说,我认为MQTT与HTTPS相比可节省50%的移动电池电量.

The article you read says that MQTT saves 50% mobile battery power compared to HTTPS, I think.

这篇关于MQTT连接消耗的功率更少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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