Skip to content
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

Example with tokio ? #21

Open
00imvj00 opened this issue Nov 9, 2017 · 1 comment
Open

Example with tokio ? #21

00imvj00 opened this issue Nov 9, 2017 · 1 comment

Comments

@00imvj00
Copy link

00imvj00 commented Nov 9, 2017

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

@zonyitoo
Copy link
Owner

zonyitoo commented Nov 9, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants