mqtt-sn-tools
mqtt-sn-tools copied to clipboard
Using -h localhost not connect
Show:
2021-12-14 12:34:17 DEBUG Debug level is: 3. 2021-12-14 12:34:17 DEBUG Network timeout is: 5 seconds. 2021-12-14 12:34:17 DEBUG Trying ::1... 2021-12-14 12:34:17 DEBUG Connecting... 2021-12-14 12:34:17 DEBUG Sending CONNECT packet... 2021-12-14 12:34:17 DEBUG Sending 24 bytes. Type=CONNECT on Socket: 3. 2021-12-14 12:34:17 DEBUG waiting for packet... recv failed: Connection refused
Hi,
It looks like 'localhost' is only resolving to ::1 (IPv6) on your machine. Is your MQTT-SN broker only listening on IPv4?
Can you try connecting to 127.0.0.1 instead?
Hi, using 127.0.0.1 works correctly. The sw using docker (using host option in docker-compose), use my etc hosts, of CentOS, the default:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
Using no host option same behavihour.
It listen as default also, ipv6 is used or ipv4 as default (netstat -putadon)
Also, defining one IP for my host in my /etc/hosts, example:
myip myhostname
And connecting using myhostname, then works correctly (using the client mqtt-sn-tools).
Summarizing:
Using: dns, 127.0.0.1, and one /etc/hosts works
Using localhost then no.
Regards, Cesar Jorge
El lun., 20 dic. 2021 14:33, Nicholas Humfrey @.***> escribió:
Hi,
It looks like 'localhost' is only resolving to ::1 (IPv6) on your machine. Is your MQTT-SN broker only listening on IPv4?
Can you try connecting to 127.0.0.1 instead?
— Reply to this email directly, view it on GitHub https://github.com/njh/mqtt-sn-tools/issues/49#issuecomment-997929010, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5N2CPOWFDUKTQ3MG76Y6LUR4WB5ANCNFSM5KAVF5EQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>