-
Notifications
You must be signed in to change notification settings - Fork 141
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
fix(iroh-net): improve hole punching when relying on call-me-maybe #1983
Conversation
dignifiedquire
commented
Jan 29, 2024
•
edited
Loading
edited
- only consider active endpoints for call-me-maybe checks
- insert call me maybe addrs into the peer map
endpoint.close() is too agressive to actually get the behaviour being checked for
/netsim branch arqu/direct_derp |
|
@@ -673,7 +672,8 @@ mod tests { | |||
let mut buf = [0u8, 5]; | |||
stream.read_exact(&mut buf).await.unwrap(); | |||
info!("Accepted 1 stream, received {buf:?}. Closing now."); | |||
ep.close(7u8.into(), b"bye").await.unwrap(); | |||
// close the stream | |||
conn.close(7u8.into(), b"bye"); |
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.
by not awaiting this you're never closing this?
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.
there is no way to actually wait for a connection close asfaik
@@ -438,7 +438,7 @@ impl Endpoint { | |||
}) | |||
.collect(); | |||
let ping_needed = !pings.is_empty(); | |||
let have_endpoints = !self.direct_addr_state.is_empty(); | |||
let have_alive_endpoints = self.direct_addr_state.values().any(|e| e.is_alive()); |
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'm currently convinced this condition is pointless, the ping_needed
condition is all that is needed here.
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.
why?
- only consider active endpoints for call-me-maybe checks - insert call me maybe addrs into the peer map