Expand description
Create a QUIC server that accepts connections +
pub struct QuicClient { /* private fields */ }Expand description
Handles the client side of QUIC address discovery.
-Implementations§
Source§impl QuicClient
impl QuicClient
Sourcepub fn new(ep: Endpoint, client_config: ClientConfig) -> Result<Self>
pub fn new(ep: Endpoint, client_config: ClientConfig) -> Result<Self>
Create a new QuicClient to handle the client side of QUIC +
Implementations§
Source§impl QuicClient
impl QuicClient
Sourcepub fn new(ep: Endpoint, client_config: ClientConfig) -> Result<Self>
pub fn new(ep: Endpoint, client_config: ClientConfig) -> Result<Self>
Create a new QuicClient to handle the client side of QUIC address discovery.
-Sourcepub async fn get_addr_and_latency(
+
pub async fn get_addr_and_latency( +
Sourcepub async fn get_addr_and_latency(
&self,
server_addr: SocketAddr,
host: &str,
diff --git a/pr/3049/docs/src/iroh_relay/quic.rs.html b/pr/3049/docs/src/iroh_relay/quic.rs.html
index 02b2f0d054..83635209fb 100644
--- a/pr/3049/docs/src/iroh_relay/quic.rs.html
+++ b/pr/3049/docs/src/iroh_relay/quic.rs.html
@@ -313,12 +313,7 @@
312
313
314
-315
-316
-317
-318
-319
-320
pub async fn get_addr_and_latency( &self, server_addr: SocketAddr, host: &str, diff --git a/pr/3049/docs/src/iroh_relay/quic.rs.html b/pr/3049/docs/src/iroh_relay/quic.rs.html index 02b2f0d054..83635209fb 100644 --- a/pr/3049/docs/src/iroh_relay/quic.rs.html +++ b/pr/3049/docs/src/iroh_relay/quic.rs.html @@ -313,12 +313,7 @@ 312 313 314 -315 -316 -317 -318 -319 -320
//! Create a QUIC server that accepts connections
+315//! Create a QUIC server that accepts connections
//! for QUIC address discovery.
use std::{net::SocketAddr, sync::Arc};
@@ -549,16 +544,11 @@
server_addr: SocketAddr,
host: &str,
) -> Result<(SocketAddr, std::time::Duration)> {
- tracing::debug!(
- "quic::QuicClient::get_addr_and_latency {:?}, {:?}, {server_addr:?}, {host:?}",
- self.ep,
- self.client_config
- );
- // let connecting = self
- // .ep
- // .connect_with(self.client_config.clone(), server_addr, host);
- // let conn = connecting?.await?;
- // let mut external_addresses = conn.observed_external_addr();
+ let connecting = self
+ .ep
+ .connect_with(self.client_config.clone(), server_addr, host);
+ let conn = connecting?.await?;
+ // let mut external_addresses = conn.observed_external_addr();
// TODO(ramfox): I'd like to be able to cancel this so we can close cleanly
// if there the task that runs this function gets aborted.
// tokio::select! {
@@ -587,10 +577,10 @@
// // that is ivp6 then the address is an [IPv4-Mapped IPv6 Addresses](https://doc.rust-lang.org/beta/std/net/struct.Ipv6Addr.html#ipv4-mapped-ipv6-addresses)
// observed_addr = SocketAddr::new(observed_addr.ip().to_canonical(), observed_addr.port());
// let latency = conn.rtt() / 2;
- // // gracefully close the connections
- // conn.close(QUIC_ADDR_DISC_CLOSE_CODE, QUIC_ADDR_DISC_CLOSE_REASON);
- // Ok((observed_addr, latency))
- anyhow::bail!("no qad");
+ // gracefully close the connections
+ conn.close(QUIC_ADDR_DISC_CLOSE_CODE, QUIC_ADDR_DISC_CLOSE_REASON);
+ // Ok((observed_addr, latency))
+ anyhow::bail!("not waiting for connections in qad");
}
}