-
Notifications
You must be signed in to change notification settings - Fork 4
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
base: main
Are you sure you want to change the base?
Conversation
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
pub fn send<'a, 'b>(&self, transmit: &'a quinn_udp::Transmit<'b>) -> SendFutQuinn<'a, 'b> { | ||
SendFutQuinn { | ||
socket: self.socket.clone(), | ||
transmit, | ||
} | ||
} |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, iroh uses this
No description provided.