diff --git a/citadel_sdk/examples/client.rs b/citadel_sdk/examples/client.rs index a89345b19..cb9f51f0b 100644 --- a/citadel_sdk/examples/client.rs +++ b/citadel_sdk/examples/client.rs @@ -1,5 +1,5 @@ use citadel_io::tokio; -use citadel_sdk::prefabs::client::{ServerConnectionSettings, ServerConnectionSettingsBuilder}; +use citadel_sdk::prefabs::client::ServerConnectionSettingsBuilder; use citadel_sdk::prelude::*; use std::sync::atomic::{AtomicBool, Ordering}; @@ -37,8 +37,7 @@ async fn main() { remote.shutdown_kernel().await?; Ok(()) }, - ) - .unwrap(); + ); let _ = NodeBuilder::default() .with_node_type(NodeType::Peer) diff --git a/citadel_sdk/examples/peer.rs b/citadel_sdk/examples/peer.rs index 19bd0ec87..1b46f93b8 100644 --- a/citadel_sdk/examples/peer.rs +++ b/citadel_sdk/examples/peer.rs @@ -19,16 +19,19 @@ async fn main() { .ensure_registered() .add(); - let finished = &AtomicBool::new(false); - let peer = citadel_sdk::prefabs::client::peer_connection::PeerConnectionKernel::new( - "dummy name", + let server_connection_settings = ServerConnectionSettingsBuilder::credentialed_registration( + addr, my_peer_id, + "dunny name", "password", + ) + .build() + .unwrap(); + + let finished = &AtomicBool::new(false); + let peer = citadel_sdk::prefabs::client::peer_connection::PeerConnectionKernel::new( + server_connection_settings, agg, - addr, - UdpMode::Enabled, - Default::default(), - None, |mut connection, remote| async move { let mut connection = connection.recv().await.unwrap()?; let chan = connection.udp_channel_rx.take(); @@ -44,8 +47,7 @@ async fn main() { } Ok(()) }, - ) - .unwrap(); + ); let _ = NodeBuilder::default() .with_node_type(NodeType::Peer) diff --git a/citadel_sdk/src/test_common.rs b/citadel_sdk/src/test_common.rs index 7002484a2..c66429a95 100644 --- a/citadel_sdk/src/test_common.rs +++ b/citadel_sdk/src/test_common.rs @@ -44,13 +44,13 @@ pub fn server_info<'a>() -> (NodeFuture<'a, EmptyKernel>, SocketAddr) { #[allow(dead_code)] #[cfg(feature = "localhost-testing")] -pub fn server_info_reactive<'a, F: 'a, Fut: 'a>( +pub fn server_info_reactive<'a, F, Fut>( f: F, opts: impl FnOnce(&mut NodeBuilder), ) -> (NodeFuture<'a, Box>, SocketAddr) where - F: Fn(ConnectionSuccess, ClientServerRemote) -> Fut + Send + Sync, - Fut: Future> + Send + Sync, + F: Fn(ConnectionSuccess, ClientServerRemote) -> Fut + Send + Sync + 'a, + Fut: Future> + Send + Sync + 'a, { crate::test_common::server_test_node( Box::new(ClientConnectListenerKernel::new(f)) as Box,