diff --git a/iroh-net/src/endpoint.rs b/iroh-net/src/endpoint.rs index 4eb7b978ae0..96f5eb577e9 100644 --- a/iroh-net/src/endpoint.rs +++ b/iroh-net/src/endpoint.rs @@ -853,14 +853,12 @@ impl Endpoint { endpoint, cancel_token, .. - } = self; + } = &self; cancel_token.cancel(); tracing::debug!("Closing connections"); endpoint.close(error_code, reason); endpoint.wait_idle().await; - // In case this is the last clone of `Endpoint`, dropping the `quinn::Endpoint` will - // make it more likely that the underlying socket is not polled by quinn anymore after this - drop(endpoint); + tracing::debug!("Connections closed"); msock.close().await?;