From eae48f9612d2391ead1963a2f49aabfd5b420aac Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Mon, 11 Mar 2019 15:26:05 -0700 Subject: [PATCH] use server backlog --- src/server.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/server.rs b/src/server.rs index 5d717817d..f80e5a0e5 100644 --- a/src/server.rs +++ b/src/server.rs @@ -83,12 +83,12 @@ where HttpServer { factory, host: None, - backlog: 2048, config: Arc::new(Mutex::new(Config { keep_alive: KeepAlive::Timeout(5), client_timeout: 5000, client_shutdown: 5000, })), + backlog: 1024, sockets: Vec::new(), builder: Some(ServerBuilder::default()), _t: PhantomData, @@ -114,8 +114,9 @@ where /// Generally set in the 64-2048 range. Default value is 2048. /// /// This method should be called before `bind()` method call. - pub fn backlog(mut self, num: i32) -> Self { - self.backlog = num; + pub fn backlog(mut self, backlog: i32) -> Self { + self.backlog = backlog; + self.builder = Some(self.builder.take().unwrap().backlog(backlog)); self }