Giter Site home page Giter Site logo

Comments (5)

adamvr avatar adamvr commented on May 11, 2024

That for loop is going to spawn a few clients. Is that the problem?

from mqtt.js.

 avatar commented on May 11, 2024

It also happens in the connect message before it actually publishes anything. You can see it if you change the on 'connect' to the following

   client.on('connect', function(packet) {
        console.log("[connect] %s", JSON.stringify(packet));
        //client.connack({returnCode: 0});
        //clients[client.id] = client;
    });

The output indicates that it has received the message more than once.

Listening on port 9999
[connect] {"cmd":"connect","retain":false,"qos":0,"dup":false,"length":24,"version":"MQIsdp","versionNum":3,"clean":false,"keepalive":3,"client":"mqtt_54049"}
[connect] {"cmd":"connect","retain":false,"qos":0,"dup":false,"length":24,"version":"MQIsdp","versionNum":3,"clean":false,"keepalive":3,"client":"mqtt_54049"}
[connect] {"cmd":"connect","retain":false,"qos":0,"dup":false,"length":24,"version":"MQIsdp","versionNum":3,"clean":false,"keepalive":3,"client":"mqtt_54049"}

from mqtt.js.

adamvr avatar adamvr commented on May 11, 2024

Yeah, you're calling createClient three times so there's going to be three separate connect packets sent.

from mqtt.js.

 avatar commented on May 11, 2024

opps ... you'e right the for loo is enclosing the createClient. Apologies for that

from mqtt.js.

cryptocifer avatar cryptocifer commented on May 11, 2024

@adamvr but...why the three client id are all the same?

from mqtt.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.