main-- / windows-gaming

This project makes it easy and straightforward to set up PCI/VGA passthrough on your system. - OR AT LEAST IT WOULD, IF IT WASNT DEAD
6 stars 1 forks source link

Use tokio-io length_delimited #154

Open oberien opened 7 years ago

oberien commented 7 years ago

Currently inside our codecs we write / read the length prefix and have logic to ensure that we only ever decode a full frame. Instead of manually taking care of it, we could use tokio-io's length_delimited, which will automatically length-prefix written messages and ensure to only ever pass full frames to the decoder.

main-- commented 7 years ago

Not possible, protobuf uses varints.

oberien commented 7 years ago

Couldn't someone™ create a PR to tokio-rs/tokio-io then to support protobuf's variants?

main-- commented 7 years ago

That would just be a different/new kind of abstraction. If we want it we can just do it here.

oberien commented 7 years ago

This is possible once tokio-rs/tokio-io#64 is merged. A sample wip implementation can be found here.