diff --git a/sdk/rust/nym-sdk/examples/tcp_proxy_multistream.rs b/sdk/rust/nym-sdk/examples/tcp_proxy_multistream.rs index 4ab10abdff..ff540302de 100644 --- a/sdk/rust/nym-sdk/examples/tcp_proxy_multistream.rs +++ b/sdk/rust/nym-sdk/examples/tcp_proxy_multistream.rs @@ -49,7 +49,7 @@ async fn main() -> anyhow::Result<()> { let listen_port = env::args().nth(3).expect("Port not specified"); - // Within the TcpProxyClient, individual client shutdown is triggered by the timeout. The final argument is how many clients to keep in reserve in the client pool. + // Within the TcpProxyClient, individual client shutdown is triggered by the timeout. The final argument is how many clients to keep in reserve in the client pool when running the TcpProxy. let proxy_client = tcp_proxy::NymProxyClient::new(server, "127.0.0.1", &listen_port, 45, Some(env), 2).await?; @@ -58,7 +58,6 @@ async fn main() -> anyhow::Result<()> { Ok::<(), anyhow::Error>(()) }); - // TODO change this to wait on the actual client to be ready (pool -> client ready state kickback via oneshot) println!("waiting for everything to be set up.."); tokio::time::sleep(tokio::time::Duration::from_secs(5)).await; println!("done. sending bytes"); diff --git a/sdk/rust/nym-sdk/examples/tcp_proxy_single_connection.rs b/sdk/rust/nym-sdk/examples/tcp_proxy_single_connection.rs index 2638ee4152..7680525321 100644 --- a/sdk/rust/nym-sdk/examples/tcp_proxy_single_connection.rs +++ b/sdk/rust/nym-sdk/examples/tcp_proxy_single_connection.rs @@ -36,9 +36,6 @@ async fn main() -> anyhow::Result<()> { // Comment this out to just see println! statements from this example, as Nym client logging is very informative but quite verbose. // The Message Decay related logging gives you an ideas of the internals of the proxy message ordering. To see the contents of the msg buffer, sphinx packet chunking, etc change the tracing::Level to DEBUG. - // tracing_subscriber::fmt() - // .with_max_level(tracing::Level::INFO) - // .init(); tracing_subscriber::registry() .with(fmt::layer()) .with(EnvFilter::new("nym_sdk::tcp_proxy=info")) @@ -64,8 +61,9 @@ async fn main() -> anyhow::Result<()> { // We'll run the instance with a long timeout since we're sending everything down the same Tcp connection, so should be using a single session. // Within the TcpProxyClient, individual client shutdown is triggered by the timeout. + // The final argument is how many clients to keep in reserve in the client pool when running the TcpProxy: since we're only expecting 1 connection in total, we can start with no clients in the pool, and the TcpProxyClient will just spin up an ephemeral client outside of the pool to use. let proxy_client = - tcp_proxy::NymProxyClient::new(*proxy_nym_addr, "127.0.0.1", &client_port, 5, Some(env), 3) + tcp_proxy::NymProxyClient::new(*proxy_nym_addr, "127.0.0.1", &client_port, 5, Some(env), 0) .await?; tokio::spawn(async move {