linux – mosquitto-client获得拒绝连接

linux – mosquitto-client获得拒绝连接,第1张

概述我想使用mosquitto库使用MQTT协议. 首先,我想做一些安装mosquitto-clients的测试 sudo apt-get install mosquitto-clients 该程序提供了两种“方法”: > mosquitto_pub > mosquitto_sub 按照this说明我正在尝试提交新主题: mosquitto_sub -d -t newtopic/test 使用默认主机 我想使用mosquitto库使用MQTT协议.

首先,我想做一些安装mosquitto-clIEnts的测试

sudo apt-get install mosquitto-clIEnts

该程序提供了两种“方法”:

> mosquitto_pub
> mosquitto_sub

按照this说明我正在尝试提交新主题:

mosquitto_sub -d -t newtopic/test

使用默认主机/端口[localhost / 1883].

我获得:

Error: Connection refused

过于通用,因为错误..任何人都可以帮助我吗?
可能是防火墙问题?在这种情况下,我该如何检查这是否是问题?

我正在使用linux ubuntu(3.8.0-42-generic#62~minision1-Ubuntu)

使用libmosquitto编写自定义程序的相同行为.

解决方法 mosquitto_pub / sub的默认主机:端口组合是localhost:1883.如果您没有在本地计算机上运行代理,那么当然它将无法连接.

解决方案是在本地计算机上运行代理,或者告诉实用程序在哪里连接.例如:

mosquitto_sub -t newtopic/test -h test.mosquitto.org
@H_419_58@ 总结

以上是内存溢出为你收集整理的linux – mosquitto-client获得拒绝连接全部内容,希望文章能够帮你解决linux – mosquitto-client获得拒绝连接所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1031908.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存