Why send two 'Binary Message' when connect, can I configure that just send one 'Binary Message'? #1850
-
Related versionsMQTT.js library version: IssueI searched online for a long time but couldn't find the answer. I use the library But if I implement the MQTT connect logic by myself( Just send one 'Binary Message' when connect), and send data use websocket, it was success. Below is my test code:
But it is strange that if i use the broker of
SpecificationAccording to the MQTT specification( http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/errata01/os/mqtt-v3.1.1-errata01-os-complete.html#_Toc442180842 ), the fixed header should be contain with 'MQTT Control Packet type (1)' when connect. QuestionSo, my question is , can I configure that just send one 'Binary Message' when connect? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
@ghzjtian Firstly you are using a very old mqttjs version, latest now is 5.5.3. Try to use that first. Writes to stream are handled by mqtt-packet, sincerly I have no clue why the connect is splitted in two binary messages. Some references in the code:
Line 833 in e991fa5
Line 833 in e991fa5
@mcollina Any clue why this could happen? |
Beta Was this translation helpful? Give feedback.
-
@robertsLando , thanks you, i upload the mqtt.js version to ^5.5.3, it just send one 'Binary Message' and connect success. |
Beta Was this translation helpful? Give feedback.
@ghzjtian Firstly you are using a very old mqttjs version, latest now is 5.5.3. Try to use that first.
Writes to stream are handled by mqtt-packet, sincerly I have no clue why the connect is splitted in two binary messages. Some references in the code:
MQTT.js/src/lib/client.ts
Line 833 in e991fa5
MQTT.js/src/lib/client.ts
Line 833 in e991fa5
@mcollina Any clue why this could happen?