diff --git a/iroh-net/bench/src/iroh.rs b/iroh-net/bench/src/iroh.rs index a359be35b2c..5a85952b7f4 100644 --- a/iroh-net/bench/src/iroh.rs +++ b/iroh-net/bench/src/iroh.rs @@ -29,7 +29,7 @@ pub fn server_endpoint(rt: &tokio::runtime::Runtime, opt: &Opt) -> (NodeAddr, En .bind(0) .await .unwrap(); - let addr = ep.local_addr(); + let addr = ep.bound_sockets(); let addr = SocketAddr::new("127.0.0.1".parse().unwrap(), addr.0.port()); let addr = NodeAddr::new(ep.node_id()).with_direct_addresses([addr]); (addr, ep) diff --git a/iroh-net/src/endpoint.rs b/iroh-net/src/endpoint.rs index 6b98bd4f45d..760809c1b45 100644 --- a/iroh-net/src/endpoint.rs +++ b/iroh-net/src/endpoint.rs @@ -650,7 +650,7 @@ impl Endpoint { /// /// The [`Endpoint`] always binds on an IPv4 address and also tries to bind on an IPv6 /// address if available. - pub fn local_addr(&self) -> (SocketAddr, Option) { + pub fn bound_sockets(&self) -> (SocketAddr, Option) { self.msock.local_addr() } @@ -1246,7 +1246,7 @@ mod tests { .bind(0) .await .unwrap(); - let eps = ep.local_addr(); + let eps = ep.bound_sockets(); info!(me = %ep.node_id().fmt_short(), ipv4=%eps.0, ipv6=?eps.1, "server bound"); for i in 0..n_clients { let now = Instant::now(); @@ -1291,7 +1291,7 @@ mod tests { .bind(0) .await .unwrap(); - let eps = ep.local_addr(); + let eps = ep.bound_sockets(); info!(me = %ep.node_id().fmt_short(), ipv4=%eps.0, ipv6=?eps.1, "client bound"); let node_addr = NodeAddr::new(server_node_id).with_relay_url(relay_url); info!(to = ?node_addr, "client connecting"); diff --git a/iroh/src/node.rs b/iroh/src/node.rs index 7f53324e352..2cbe09d4b77 100644 --- a/iroh/src/node.rs +++ b/iroh/src/node.rs @@ -108,7 +108,7 @@ impl Node { /// can contact the node consider using [`Node::local_endpoint_addresses`]. However the /// port will always be the concrete port. pub fn local_address(&self) -> Vec { - let (v4, v6) = self.inner.endpoint.local_addr(); + let (v4, v6) = self.inner.endpoint.bound_sockets(); let mut addrs = vec![v4]; if let Some(v6) = v6 { addrs.push(v6); diff --git a/iroh/src/node/builder.rs b/iroh/src/node/builder.rs index 59782b20104..62098833884 100644 --- a/iroh/src/node/builder.rs +++ b/iroh/src/node/builder.rs @@ -552,7 +552,7 @@ where ) { let rpc = RpcServer::new(rpc); let internal_rpc = RpcServer::new(internal_rpc); - let (ipv4, ipv6) = server.local_addr(); + let (ipv4, ipv6) = server.bound_sockets(); debug!( "listening at: {}{}", ipv4,