{"id":69365,"date":"2023-12-18T07:29:26","date_gmt":"2023-12-17T23:29:26","guid":{"rendered":"\/\/www.viralrail.com\/?p=69365"},"modified":"2023-12-18T07:29:26","modified_gmt":"2023-12-17T23:29:26","slug":"mxyuhst","status":"publish","type":"post","link":"\/\/www.viralrail.com\/blog\/69365.html","title":{"rendered":"MQTT\u534f\u8bae\uff1aUDP\u8fd8\u662fTCP"},"content":{"rendered":"
MQTT\u534f\u8bae\u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u6d88\u606f\u4f20\u8f93\u534f\u8bae\uff0c\u5e38\u7528\u4e8e\u7269\u8054\u7f51\u8bbe\u5907<\/a>\u95f4\u7684\u901a\u4fe1\u3002\u672c\u6587\u5c06\u63a2\u8ba8MQTT\u534f\u8bae\u4f7f\u7528\u7684\u662fUDP<\/a>\u8fd8\u662fTCP\uff0c\u4ee5\u53ca\u5b83\u4eec\u5404\u81ea\u7684\u4f18\u52a3\u52bf\u3002<\/p>\n MQTT\uff08Message Queuing Telemetry Transport\uff09\u662f\u4e00\u79cd\u57fa\u4e8e\u53d1\u5e03\/\u8ba2\u9605\u6a21\u5f0f\u7684\u901a\u4fe1\u534f\u8bae\uff0c\u6700\u521d\u7531IBM\u5f00\u53d1\u3002\u5b83\u88ab\u8bbe\u8ba1\u7528\u4e8e\u4f4e\u5e26\u5bbd\u3001\u4e0d\u7a33\u5b9a\u7f51\u7edc\u6216\u8005\u5bf9\u7f51\u7edc\u5ef6\u8fdf\u654f\u611f\u7684\u73af\u5883\u4e0b\u7684\u901a\u4fe1\u3002<\/p>\n MQTT\u91c7\u7528\u8f7b\u91cf\u7ea7\u7684\u534f\u8bae\u5934\uff0c\u5360\u7528\u8f83\u5c11\u7684\u7f51\u7edc\u8d44\u6e90\uff0c\u9002\u7528\u4e8e\u79fb\u52a8\u8bbe\u5907\u7b49\u8d44\u6e90\u53d7\u9650\u7684\u73af\u5883\u3002\u5b83\u4f7f\u7528\u53d1\u5e03\/\u8ba2\u9605\u6d88\u606f\u6a21\u5f0f\uff0c\u901a\u8fc7MQTT\u4ee3\u7406\u670d\u52a1\u5668\uff08broker\uff09\u8fdb\u884c\u6d88\u606f\u8f6c\u53d1\u3002<\/p>\n MQTT\u534f\u8bae\u5177\u6709\u5373\u65f6\u901a\u8baf\u3001\u6570\u636e\u91cf\u5c0f\u3001\u5b9e\u65f6\u6027\u597d\u7684\u7279\u70b9\uff0c\u56e0\u6b64\u5728\u7269\u8054\u7f51\u3001\u4f20\u611f\u5668\u7f51\u7edc\u3001\u79fb\u52a8\u8bbe\u5907\u7b49\u9886\u57df\u5f97\u5230\u5e7f\u6cdb\u5e94\u7528\u3002<\/p>\n MQTT\u534f\u8bae\u5b9e\u9645\u4e0a\u662f\u5efa\u7acb\u5728TCP\u534f\u8bae\u4e4b\u4e0a\u7684\uff0c\u5b83\u4f7f\u7528TCP\u534f\u8bae\u63d0\u4f9b\u7684\u53ef\u9760\u4f20\u8f93\u7279\u6027\u8fdb\u884c\u6570\u636e\u901a\u4fe1\u3002\u6b64\u5916\uff0cMQTT\u534f\u8bae\u4e5f\u53ef\u4ee5\u8fd0\u884c\u5728\u57fa\u4e8eUDP\u534f\u8bae\u7684MQTT-SN\uff08MQTT for Sensor Networks\uff09\u7248\u672c\u3002<\/p>\n TCP\uff08Transmission Control Protocol\uff09\u662f\u4e00\u79cd\u53ef\u9760\u7684\u3001\u9762\u5411\u8fde\u63a5\u7684\u534f\u8bae\uff0c\u9002\u7528\u4e8e\u5bf9\u6570\u636e\u4f20\u8f93\u53ef\u9760\u6027\u8981\u6c42\u8f83\u9ad8\u7684\u573a\u666f\u3002MQTT\u5728TCP\u534f\u8bae\u4e0a\u5efa\u7acb\u8fde\u63a5\uff0c\u901a\u8fc7TCP\u8fdb\u884c\u6570\u636e\u4f20\u8f93\uff0c\u4fdd\u8bc1\u6d88\u606f\u7684\u53ef\u9760\u6027\u3002<\/p>\n \u901a\u8fc7TCP\u4f20\u8f93\uff0c\u4fdd\u8bc1\u4e86\u6d88\u606f\u7684\u53ef\u9760\u6027\u548c\u7a33\u5b9a\u6027\uff0c\u9002\u7528\u4e8e\u5bf9\u6d88\u606f\u4f20\u8f93\u5b89\u5168\u6027\u8981\u6c42\u8f83\u9ad8\u7684\u573a\u666f\u3002<\/p>\nMQTT\u534f\u8bae\u6982\u8ff0<\/h2>\n
\u5de5\u4f5c\u539f\u7406<\/h3>\n
\u7279\u70b9<\/h3>\n
MQTT\u534f\u8bae\u4e0eUDP\/TCP\u7684\u5173\u7cfb<\/h2>\n
TCP\u534f\u8bae\u4e0eMQTT<\/h3>\n
\u4f18\u52bf<\/h4>\n
\u52a3\u52bf<\/h4>\n