mqtt-rs icon indicating copy to clipboard operation
mqtt-rs copied to clipboard

Example with tokio ?

Open 00imvj00 opened this issue 8 years ago • 1 comments

Hello, can you please provide example with Tokio-core ?

00imvj00 avatar Nov 09 '17 06:11 00imvj00

If you want to work it with tokio, you have to parse packet in two steps:

  1. Parse FixedHeader

  2. And then, use the remaining_length field to get the remaining data. Parse the remaining one with Packet::decode_packet

Works exactly like this: https://github.com/zonyitoo/mqtt-rs/blob/master/src/packet/mod.rs#L221-L252

zonyitoo avatar Nov 09 '17 11:11 zonyitoo