Skip to content

Commit

Permalink
use iroh::net
Browse files Browse the repository at this point in the history
  • Loading branch information
flub committed May 10, 2024
1 parent c1d95f4 commit 0c303f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion iroh-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ human-time = "0.1.6"
indicatif = { version = "0.17", features = ["tokio"] }
iroh = { version = "0.15.0", path = "../iroh", features = ["metrics"] }
iroh-metrics = { version = "0.15.0", path = "../iroh-metrics" }
iroh-net = { version = "0.15.0", path = "../iroh-net" }
parking_lot = "0.12.1"
pkarr = { version = "1.1.5", default-features = false }
portable-atomic = "1"
Expand Down
18 changes: 9 additions & 9 deletions iroh-cli/src/commands/doctor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ fn update_pb(

/// handle a test stream request
async fn handle_test_request(
mut send: iroh_net::magic_endpoint::SendStream,
mut recv: iroh_net::magic_endpoint::RecvStream,
mut send: iroh::net::magic_endpoint::SendStream,
mut recv: iroh::net::magic_endpoint::RecvStream,
gui: &Gui,
) -> anyhow::Result<()> {
let mut buf = [0u8; TestStreamRequest::POSTCARD_MAX_SIZE];
Expand Down Expand Up @@ -477,7 +477,7 @@ Ipv6:
}

async fn active_side(
connection: iroh_net::magic_endpoint::Connection,
connection: iroh::net::magic_endpoint::Connection,
config: &TestConfig,
gui: Option<&Gui>,
) -> anyhow::Result<()> {
Expand All @@ -504,7 +504,7 @@ async fn active_side(
}

async fn send_test_request(
send: &mut iroh_net::magic_endpoint::SendStream,
send: &mut iroh::net::magic_endpoint::SendStream,
request: &TestStreamRequest,
) -> anyhow::Result<()> {
let mut buf = [0u8; TestStreamRequest::POSTCARD_MAX_SIZE];
Expand All @@ -514,7 +514,7 @@ async fn send_test_request(
}

async fn echo_test(
connection: &iroh_net::magic_endpoint::Connection,
connection: &iroh::net::magic_endpoint::Connection,
config: &TestConfig,
pb: Option<&indicatif::ProgressBar>,
) -> anyhow::Result<Duration> {
Expand All @@ -535,7 +535,7 @@ async fn echo_test(
}

async fn send_test(
connection: &iroh_net::magic_endpoint::Connection,
connection: &iroh::net::magic_endpoint::Connection,
config: &TestConfig,
pb: Option<&indicatif::ProgressBar>,
) -> anyhow::Result<Duration> {
Expand All @@ -559,7 +559,7 @@ async fn send_test(
}

async fn recv_test(
connection: &iroh_net::magic_endpoint::Connection,
connection: &iroh::net::magic_endpoint::Connection,
config: &TestConfig,
pb: Option<&indicatif::ProgressBar>,
) -> anyhow::Result<Duration> {
Expand Down Expand Up @@ -588,7 +588,7 @@ async fn recv_test(
/// Passive side that just accepts connections and answers requests (echo, drain or send)
async fn passive_side(
endpoint: MagicEndpoint,
connection: iroh_net::magic_endpoint::Connection,
connection: iroh::net::magic_endpoint::Connection,
) -> anyhow::Result<()> {
let remote_peer_id = magic_endpoint::get_remote_node_id(&connection)?;
let gui = Gui::new(endpoint, remote_peer_id);
Expand Down Expand Up @@ -626,7 +626,7 @@ async fn make_endpoint(
);
tracing::info!("relay map {:#?}", relay_map);

let mut transport_config = iroh_net::magic_endpoint::TransportConfig::default();
let mut transport_config = iroh::net::magic_endpoint::TransportConfig::default();
transport_config.keep_alive_interval(Some(Duration::from_secs(5)));
transport_config.max_idle_timeout(Some(Duration::from_secs(10).try_into().unwrap()));

Expand Down

0 comments on commit 0c303f1

Please sign in to comment.