From abf60a8cf9a47c718af0755af6094b17838f3daf Mon Sep 17 00:00:00 2001 From: Dylan Abraham Date: Wed, 22 Oct 2025 14:21:12 -0700 Subject: [PATCH] allowing configuring buffer allocation increments for raw protosocket servers --- protosocket-server/src/connection_server.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/protosocket-server/src/connection_server.rs b/protosocket-server/src/connection_server.rs index cd8eeeb..bdcdc53 100644 --- a/protosocket-server/src/connection_server.rs +++ b/protosocket-server/src/connection_server.rs @@ -25,14 +25,6 @@ pub trait ServerConnector: Unpin { address: SocketAddr, ) -> ::Reactor; - fn maximum_message_length(&self) -> usize { - 4 * (2 << 20) - } - - fn max_queued_outbound_messages(&self) -> usize { - 256 - } - fn connect( &self, stream: tokio::net::TcpStream, @@ -95,6 +87,11 @@ impl ProtosocketServer { pub fn set_max_queued_outbound_messages(&mut self, max_queued_outbound_messages: usize) { self.max_queued_outbound_messages = max_queued_outbound_messages; } + + /// Set the step size for allocating additional memory for connection buffers created by this server after the setting is applied. + pub fn set_buffer_allocation_increment(&mut self, buffer_allocation_increment: usize) { + self.buffer_allocation_increment = buffer_allocation_increment; + } } impl Future for ProtosocketServer {