-
Notifications
You must be signed in to change notification settings - Fork 115
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
impl Stream/Sink for UdpSocket #276
Comments
Thanks for the report! This sort of raises similar questions to tokio-rs/tokio-io#78 in that it's not clear what the right type is here ( I could imagine though that having a codec or two baked in would also be fine though! |
I'm fine with either An alternative, (though it may be less efficient, I haven't thought about this too hard), would be to have |
Indeed yeah! There's crate like tokio-serde-bincode to do that for you |
@canndrew Would tokio-rs/tokio-io#82 help solve your usecase? |
That would certainly be a more efficient of way doing it, I see the problem now with just making |
I'd like to use a
UdpSocket
as aStream
/Sink
of(SocketAddr, Vec<u8>)
. Is there a reason these impls don't already exist? I'm aware I can useFramed
, but I'd prefer not to have to write aUdpCodec
for converting bytes to bytes. IMHOUdpCodec
belongs in some higher-level library andtokio-core
should just provide a UDP API for sending/receiving packets of bytes.The text was updated successfully, but these errors were encountered: