-
Notifications
You must be signed in to change notification settings - Fork 1k
incompatible remaining_length in connect #165
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
Comments
Hi,
Willee Gong |
Duplicate of #163 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
In CONNECT Packet fixed header, The Remaining Length is encoded using a variable length encoding scheme which uses a single byte for values up to 127. Larger values are handled as follows. The least significant seven bits of each byte encode the data, and the most significant bit is used to indicate that there are following bytes in the representation. Thus each byte encodes 128 values and a "continuation bit". The maximum number of bytes in the Remaining Length field is four.
Size of Remaining Length
#Byte x From=>To
#1:0(0x00)=>127(0x7F);
#2:128(0x80,0x01)=>16383(0xFF,0x7F
#3:16384(0x80,0x80,0x01)=>2097151(0xFF,0xFF,0x7F)
#4:2097152(0x80,0x80,0x80,0x01)=>268435455(0xFF,0xFF,0xFF,0x7F)
Willee Gong
The text was updated successfully, but these errors were encountered: