Skip to content

feat(netwatch): adjust for quinn api changes #26

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dignifiedquire
Copy link
Contributor

No description provided.

Copy link

github-actions bot commented May 23, 2025

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/net-tools/pr/26/docs/net_tools/

Last updated: 2025-05-27T08:52:18Z

Copy link
Member

Choose a reason for hiding this comment

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

Sorry for the whole confusion here.
It might be helpful to move this file to interfaces/native.rs so it lives on the same level as wasm_browser.rs.
The hope would be this makes it a lot clearer that they implement the same stuff.

if this.fut.is_none() {
let socket = this.socket.clone();
this.fut.set(Some(Box::pin(async move {
n0_future::future::poll_fn(|cx| socket.poll_writable(cx)).await
Copy link
Member

Choose a reason for hiding this comment

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

Looking at the implementation of poll_writable, it seems like this will use poll_send_ready, which I think isn't safe to use from multiple tasks concurrently?
I think this needs to call tokio's .writable() deep down instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I's the same limitations as before/we have currently. Yes it looses wakers, but this can only be fully fixed if the udpsocket here stored the wakers, not by using the future internally, as on rebind we need to wake all of them, so relying on tokios internals is not enough

Comment on lines +878 to +883
pub fn send<'a, 'b>(&self, transmit: &'a quinn_udp::Transmit<'b>) -> SendFutQuinn<'a, 'b> {
SendFutQuinn {
socket: self.socket.clone(),
transmit,
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Is this used? I guess I don't know the downstream dependencies and which public functions are used.
All I know is quinn doesn't need this, but it might be used somewhere in net-report etc.
(making sure we don't accidentally leave fns we don't necessarily need)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, iroh uses this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

2 participants