Skip to content

Commit fb45100

Browse files
authored
configure buffer allocation increments for raw protosocket servers (#11)
1 parent e508991 commit fb45100

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

protosocket-server/src/connection_server.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ pub trait ServerConnector: Unpin {
2525
address: SocketAddr,
2626
) -> <Self::Bindings as ConnectionBindings>::Reactor;
2727

28-
fn maximum_message_length(&self) -> usize {
29-
4 * (2 << 20)
30-
}
31-
32-
fn max_queued_outbound_messages(&self) -> usize {
33-
256
34-
}
35-
3628
fn connect(
3729
&self,
3830
stream: tokio::net::TcpStream,
@@ -95,6 +87,11 @@ impl<Connector: ServerConnector> ProtosocketServer<Connector> {
9587
pub fn set_max_queued_outbound_messages(&mut self, max_queued_outbound_messages: usize) {
9688
self.max_queued_outbound_messages = max_queued_outbound_messages;
9789
}
90+
91+
/// Set the step size for allocating additional memory for connection buffers created by this server after the setting is applied.
92+
pub fn set_buffer_allocation_increment(&mut self, buffer_allocation_increment: usize) {
93+
self.buffer_allocation_increment = buffer_allocation_increment;
94+
}
9895
}
9996

10097
impl<Connector: ServerConnector> Future for ProtosocketServer<Connector> {

0 commit comments

Comments
 (0)