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 #4131

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

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-net Module: tokio/net labels Sep 23, 2021
@Darksonn
Copy link
Contributor

Please check the rustfmt CI job.

/// 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

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.

Comment on lines 673 to 674
/// 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

Choose a reason for hiding this comment

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

Same here.

@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

Sure, that makes sense to me.

@Darksonn
Copy link
Contributor

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
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>
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Thanks.

@Darksonn Darksonn merged commit d32acd9 into tokio-rs:master Sep 24, 2021
@baloo baloo deleted the baloo/udp-poll_ready branch September 24, 2021 18:51
suikammd pushed a commit to suikammd/tokio that referenced this pull request Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-net Module: tokio/net
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants