Skip to content

Conversation

@martin-g
Copy link
Member

@martin-g martin-g commented Sep 10, 2025

Motivation

  • On Windows the self.io.peek() method may return an error, not peek_from
  • poll_peek() does not return the sender address on success. It returns Poll::Ready(Ok(())) indicating no problems during the peek
  • A comment mentions recv that read the n bytes. It is actually self.io.peek()

Solution

Fix the typos / copy-paste errors in docs and comments

* On Windows the self.io.peek() method may return an error, not
  `peek_from`
* poll_peek() does not return the sender address on success. It returns
  Poll::Ready(Ok(())) indicating no problems during the peek
* A comment mentions `recv` that read the `n` bytes. It is actually
  self.io.peek()
@ADD-SP ADD-SP added T-docs Topic: documentation M-net Module: tokio/net labels Sep 10, 2025
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 added the A-tokio Area: The main tokio crate label Sep 10, 2025
@Darksonn Darksonn merged commit d8e8037 into tokio-rs:master Sep 10, 2025
103 checks passed
@martin-g martin-g deleted the copy-paste-doc-for-udp-poll_peek branch September 10, 2025 14:44
@Darksonn Darksonn mentioned this pull request Oct 14, 2025
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 T-docs Topic: documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants