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

net: add poll_{recv,send}_ready methods to udp/uds_datagram

Merged
merged 2 commits into from Sep 24, 2021

Conversation

baloo
Copy link
Contributor

@baloo baloo commented Sep 23, 2021

Motivation

UDP was missing poll_read_ready and poll_write_ready methods
UDS datagram was missing them as well

Solution

similar to unix and tcp sockets, this brings poll_read_ready and
poll_write_ready methods to udp and UDS Datagram

@baloo baloo force-pushed the baloo/udp-poll_ready branch from 8f224af to a7a8325 Compare Sep 23, 2021
@Darksonn Darksonn added A-tokio M-net labels Sep 23, 2021
@Darksonn
Copy link
Contributor

Darksonn commented Sep 23, 2021

Please check the rustfmt CI job.

@baloo baloo force-pushed the baloo/udp-poll_ready branch from a7a8325 to d67a388 Compare Sep 23, 2021
/// stream becomes ready for writing, `Waker::wake` will be called on the
/// waker.
///
/// Note that on multiple calls to `poll_write_ready` or `poll_write`, only
Copy link
Contributor

@Darksonn Darksonn Sep 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no poll_write method on UdpSocket. This should instead mention poll_send and poll_send_to.

/// Note that on multiple calls to `poll_read_ready`, `poll_read` or
/// `poll_peek`, only the `Waker` from the `Context` passed to the most
Copy link
Contributor

@Darksonn Darksonn Sep 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@baloo baloo force-pushed the baloo/udp-poll_ready branch from d67a388 to 4a19b23 Compare Sep 23, 2021
@baloo
Copy link
Contributor Author

baloo commented Sep 23, 2021

shouldn't we rename the two methods poll_recv_ready and poll_send_ready?

@Darksonn
Copy link
Contributor

Darksonn commented Sep 24, 2021

Sure, that makes sense to me.

@Darksonn
Copy link
Contributor

Darksonn commented Sep 24, 2021

I just noticed that the methods are also missing on UnixDatagram.

@baloo baloo changed the title net: add poll_{write,read}_ready methods to udp net: add poll_{recv,send}_ready methods to udp/uds_datagram Sep 24, 2021
@baloo baloo force-pushed the baloo/udp-poll_ready branch from 4a19b23 to bf096a9 Compare Sep 24, 2021
baloo added 2 commits Sep 24, 2021
similar to unix and tcp sockets, this commits brings `poll_read_ready` and
`poll_write_ready` methods.

Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
@baloo baloo force-pushed the baloo/udp-poll_ready branch from bf096a9 to 5291bc6 Compare Sep 24, 2021
Copy link
Contributor

@Darksonn Darksonn left a comment

Thanks.

@Darksonn Darksonn merged commit d32acd9 into tokio-rs:master Sep 24, 2021
27 checks passed
@baloo baloo deleted the baloo/udp-poll_ready branch Sep 24, 2021
suikammd pushed a commit to suikammd/tokio that referenced this issue Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio M-net
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants