From 7fa1cdba93c8e7692e8dc5b1c63bf73d35341a8a Mon Sep 17 00:00:00 2001 From: mfahampshire Date: Mon, 16 Dec 2024 18:51:05 +0100 Subject: [PATCH] remove comments for future ffi push + lower default pool size from 4 to 2 --- sdk/ffi/shared/src/lib.rs | 23 ------------------- .../nym-sdk/src/tcp_proxy/tcp_proxy_client.rs | 2 +- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/sdk/ffi/shared/src/lib.rs b/sdk/ffi/shared/src/lib.rs index 4a09a63c8d..e7a770f269 100644 --- a/sdk/ffi/shared/src/lib.rs +++ b/sdk/ffi/shared/src/lib.rs @@ -22,15 +22,6 @@ lazy_static! { static ref RUNTIME: Runtime = Runtime::new().unwrap(); } -// TODO create get_client() to use in fns and remove code repetition -fn get_client_as_ref() -> bool { - NYM_CLIENT.lock().unwrap().as_ref().is_some() -} - -fn get_client_guard() -> bool { - todo!() -} - pub fn init_ephemeral_internal() -> Result<(), Error> { if NYM_CLIENT.lock().unwrap().as_ref().is_some() { bail!("client already exists"); @@ -46,20 +37,6 @@ pub fn init_ephemeral_internal() -> Result<(), Error> { Ok::<(), Error>(()) })?; } - // if get_client_as_ref() { - // RUNTIME.block_on(async move { - // let init_client = MixnetClient::connect_new().await?; - // let mut client = NYM_CLIENT.try_lock(); - // if let Ok(ref mut client) = client { - // **client = Some(init_client); - // } else { - // return Err(anyhow!("couldnt lock ephemeral NYM_CLIENT")); - // } - // Ok::<(), Error>(()) - // })?; - // } else { - // bail!("client already exists: no need to reinitialise"); - // } Ok(()) } diff --git a/sdk/rust/nym-sdk/src/tcp_proxy/tcp_proxy_client.rs b/sdk/rust/nym-sdk/src/tcp_proxy/tcp_proxy_client.rs index eb176f39d5..ae74464a69 100644 --- a/sdk/rust/nym-sdk/src/tcp_proxy/tcp_proxy_client.rs +++ b/sdk/rust/nym-sdk/src/tcp_proxy/tcp_proxy_client.rs @@ -20,7 +20,7 @@ use utils::{MessageBuffer, Payload, ProxiedMessage}; const DEFAULT_CLOSE_TIMEOUT: u64 = 60; // seconds const DEFAULT_LISTEN_HOST: &str = "127.0.0.1"; const DEFAULT_LISTEN_PORT: &str = "8080"; -const DEFAULT_CLIENT_POOL_SIZE: usize = 4; +const DEFAULT_CLIENT_POOL_SIZE: usize = 2; pub struct NymProxyClient { server_address: Recipient,