Skip to content

Commit 55769a7

Browse files
fixup
1 parent fe327cc commit 55769a7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

iroh/examples/screening-connection.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::sync::{
1313
};
1414

1515
use iroh::{
16-
Endpoint, NodeAddr, Watcher,
16+
Endpoint, NodeAddr,
1717
endpoint::{Connecting, Connection},
1818
protocol::{AcceptError, ProtocolHandler, Router},
1919
};
@@ -28,7 +28,9 @@ const ALPN: &[u8] = b"iroh-example/screening-connection/0";
2828
#[tokio::main]
2929
async fn main() -> Result<()> {
3030
let router = start_accept_side().await?;
31-
let node_addr = router.endpoint().node_addr().initialized().await;
31+
// Wait for the endpoint to be reachable
32+
router.endpoint().online().await;
33+
let node_addr = router.endpoint().node_addr();
3234

3335
// call connect three times. connection index 1 will be an odd number, and rejected.
3436
connect_side(&node_addr).await?;

0 commit comments

Comments
 (0)