Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

constant disconnections #237

Closed
hellish opened this issue Jan 16, 2015 · 1 comment
Closed

constant disconnections #237

hellish opened this issue Jan 16, 2015 · 1 comment

Comments

@hellish
Copy link

hellish commented Jan 16, 2015

So I tried the following

var mqtt = require('mqtt'),
    mqtt_url = 'mqtt://test.mosquitto.org:1883';

var client = mqtt.connect(mqtt_url);

client.on('connect', function() {
    console.log('>> connected', arguments);
}).on('offline', function() {
    console.log('>> offline', arguments);
}).on('error', function() {
    console.log('>> error', arguments);
}).on('close', function() {
    console.log('>> connected', arguments);
}).on('message', function() {
    console.log('>> message', arguments);
});

which is similar with the example in README.md
and I get the following

>> offline {}
>> connected { '0': { [Error: getaddrinfo ENOTFOUND] code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo' } }
>> offline {}
>> connected { '0': { [Error: getaddrinfo ENOTFOUND] code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo' } }
>> offline {}
>> connected { '0': { [Error: getaddrinfo ENOTFOUND] code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo' } }
...

This happens on with 1.x. not in the 0.3.x which worked fine. Any idea of what am I doing wrong?

@mcollina
Copy link
Member

There is a problem in parsing the port number (so weird): if you use 'mqtt://test.mosquitto.org' everything works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants