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

util: resurrect UdpFramed #3044

Merged
merged 5 commits into from Nov 6, 2020
Merged

Conversation

leshow
Copy link
Contributor

@leshow leshow commented Oct 25, 2020

Motivation

Brings back UdpFramed in tokio-util. This was the only way to create a Stream/Sink from a UdpSocket using Decoder/Encoder so I think it's important to have.

In earlier commits I had also brought back split for UdpSocket but I've removed that for now. I wanted a way to split on UdpFramed also and get an independent Stream/Sink, but there's no way to share the Codec among both sides that I can see, since they both require &mut access. So for now, just bringing back UdpFramed

Solution

Mostly just un-commenting what was there with some small modifications due to ReadBuf

I think this closes out #2830 , we've added back poll_* functions for UdpSocket and UdpFramed

@leshow leshow changed the title util: resurrect udp framed util: resurrect UdpFramed Oct 25, 2020
@Darksonn Darksonn added A-tokio-util Area: The tokio-util crate C-enhancement Category: A PR with an enhancement or bugfix. M-net Module: tokio/net labels Oct 25, 2020
tokio-util/Cargo.toml Outdated Show resolved Hide resolved
tokio-util/src/cfg.rs Show resolved Hide resolved
tokio-util/src/udp/frame.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-util Area: The tokio-util crate C-enhancement Category: A PR with an enhancement or bugfix. M-net Module: tokio/net
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants