From ac728a2aff95f7e05ebc9854c17f33b3a5bcda93 Mon Sep 17 00:00:00 2001 From: Astro Date: Wed, 18 Mar 2020 21:15:34 +0100 Subject: [PATCH] server: reduce sockets from 8 to 4 for memory savings --- src/server.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/server.rs b/src/server.rs index b48b230..5a1005f 100644 --- a/src/server.rs +++ b/src/server.rs @@ -15,7 +15,7 @@ pub struct SocketState { /// Number of server sockets and therefore concurrent client /// sessions. Many data structures in `Server::run()` correspond to /// this const. -const SOCKET_COUNT: usize = 8; +const SOCKET_COUNT: usize = 4; const TCP_RX_BUFFER_SIZE: usize = 2048; const TCP_TX_BUFFER_SIZE: usize = 2048; @@ -52,10 +52,6 @@ impl<'a, 'b, S: Default> Server<'a, 'b, S> { create_socket!(sockets, tcp_rx_storage1, tcp_tx_storage1, states[1].handle); create_socket!(sockets, tcp_rx_storage2, tcp_tx_storage2, states[2].handle); create_socket!(sockets, tcp_rx_storage3, tcp_tx_storage3, states[3].handle); - create_socket!(sockets, tcp_rx_storage4, tcp_tx_storage4, states[4].handle); - create_socket!(sockets, tcp_rx_storage5, tcp_tx_storage5, states[5].handle); - create_socket!(sockets, tcp_rx_storage6, tcp_tx_storage6, states[6].handle); - create_socket!(sockets, tcp_rx_storage7, tcp_tx_storage7, states[7].handle); for state in &mut states { state.state = S::default();