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

feat: add try_* and readiness methods to UdpSocket #101

Merged
merged 1 commit into from
Mar 13, 2023

Conversation

camshaft
Copy link
Collaborator

Description

This change includes several tokio-compatible methods for UdpSocket:

I've also added the UdpSocket to the Send+Sync tests.

Callouts

I needed to add a RX buffer since mpsc::Receiver doesn't have a way to just query if the channel has a message without taking the message.

@camshaft camshaft requested a review from mcches March 10, 2023 20:59
rx: Mutex<Rx>,
}

struct Rx {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice solution! I'm going to take on a task to refactor this into the host similar to what TCP is doing. That should simplify some things.

@mcches mcches merged commit f2fd9bb into tokio-rs:main Mar 13, 2023
@camshaft camshaft deleted the try-udp branch March 13, 2023 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants