Home > other >  MQTT content networking protocol transmission problems
MQTT content networking protocol transmission problems

Time:09-28

Good passing bosses,

I want to achieve a similar frame in the function of the bridge between the client and the agent, detected a frame after MQTT message transmission,

Because the MQTT protocol fixed message header is change depending on the type of message, follow-up and no checking computation, think that it is easy to appear the situation of the test frame error detection (), such as frame loss among a byte, according to the length of the value, will put a frame of the frame after the head in at the end of the first frame,

This two days see one about MQTT source + LWIP TCP/IP protocol stack to realize library, looking at the source code is in the first data from the TCP package began to press frame head to check, illegal in starting the next check, legal began to take the frame length, according to one frame to take out the length of the complete message, if it is my understanding that should be easy to appear error detection,

I do not know what is the solution to, I was right agreement or source code, hope comment,

CodePudding user response:

Won't appear what you say, TCP protocol itself is orderly and reliable transmission, skip the byte received do not exist, if transfer 2 consecutive frames, the receiving frame 2, the first byte, 1 frame must have all the transfer is completed,
  • Related