Comments (5)
That for loop is going to spawn a few clients. Is that the problem?
from mqtt.js.
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.
Yeah, you're calling createClient three times so there's going to be three separate connect packets sent.
from mqtt.js.
opps ... you'e right the for loo is enclosing the createClient. Apologies for that
from mqtt.js.
@adamvr but...why the three client id are all the same?
from mqtt.js.
Related Issues (20)
- Replace standard with eslint + prettier
- MQTT v5 Feedbacks HOT 41
- FEATURE - Convert to Typescript
- native promise/async support HOT 3
- Try replace `duplexify` with nodejs `stream.duplex`
- Drop `connect` HOT 5
- Problem of sending outgoingStore data even though CONNACK sessionPresent is false HOT 1
- Close received after close HOT 2
- process.nextTick is not a function HOT 1
- Replace airtap with wtr
- Identifier 'Buffer' has already been declared HOT 22
- "npm install mqtt -g" doesn't install command line tool. HOT 2
- Promise from `connectAsync` never resolves with `manualConnect: true` HOT 5
- mqtt 5.0.2 webpack 5 and chrome 53 and lower HOT 1
- Uncaught ReferenceError: process is not defined HOT 1
- Repeated end events did not properly disconnect HOT 3
- process has not been defined HOT 1
- How can I know the connection is kicked by the same clientId ? HOT 1
- Uncaught TypeError: Cannot read properties of undefined (reading 'connect') HOT 2
- Flagged use of navigator.userAgent HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mqtt.js.