From f22bc41e3d2b6efbc7a300d80f16bfbe8a533d47 Mon Sep 17 00:00:00 2001 From: Dylan Abraham Date: Thu, 16 Oct 2025 12:06:50 -0700 Subject: [PATCH 1/2] chore: pass socket address into protosocket servers --- example-telnet/src/main.rs | 1 + protosocket-server/src/connection_server.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/example-telnet/src/main.rs b/example-telnet/src/main.rs index 415b9bd..ff68d61 100644 --- a/example-telnet/src/main.rs +++ b/example-telnet/src/main.rs @@ -47,6 +47,7 @@ impl ServerConnector for ServerContext { optional_outbound: tokio::sync::mpsc::Sender< <::Serializer as Serializer>::Message, >, + _address: std::net::SocketAddr, ) -> ::Reactor { StringReactor { outbound: optional_outbound, diff --git a/protosocket-server/src/connection_server.rs b/protosocket-server/src/connection_server.rs index 9d7e676..8af888b 100644 --- a/protosocket-server/src/connection_server.rs +++ b/protosocket-server/src/connection_server.rs @@ -1,5 +1,6 @@ use std::future::Future; use std::io::Error; +use std::net::SocketAddr; use std::pin::Pin; use std::sync::Arc; use std::task::Context; @@ -21,6 +22,7 @@ pub trait ServerConnector: Unpin { optional_outbound: mpsc::Sender< <::Serializer as Serializer>::Message, >, + address: SocketAddr ) -> ::Reactor; fn maximum_message_length(&self) -> usize { @@ -108,7 +110,7 @@ impl Future for ProtosocketServer { mpsc::channel(self.max_queued_outbound_messages); let reactor = self .connector - .new_reactor(outbound_submission_queue.clone()); + .new_reactor(outbound_submission_queue.clone(), address); let stream = self.connector.connect(stream); let connection: Connection = Connection::new( stream, From 0590247b09fa37cca0a80215cb2c6aa71c94d66d Mon Sep 17 00:00:00 2001 From: Dylan Abraham Date: Thu, 16 Oct 2025 12:08:20 -0700 Subject: [PATCH 2/2] chore: fmt --- protosocket-server/src/connection_server.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protosocket-server/src/connection_server.rs b/protosocket-server/src/connection_server.rs index 8af888b..cd8eeeb 100644 --- a/protosocket-server/src/connection_server.rs +++ b/protosocket-server/src/connection_server.rs @@ -22,7 +22,7 @@ pub trait ServerConnector: Unpin { optional_outbound: mpsc::Sender< <::Serializer as Serializer>::Message, >, - address: SocketAddr + address: SocketAddr, ) -> ::Reactor; fn maximum_message_length(&self) -> usize {