1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-26 19:41:12 +00:00

Allow to use std::net::TcpListener for HttpServer

This commit is contained in:
Nikolay Kim 2018-03-07 11:28:44 -08:00
parent 24342fb745
commit 0bf29a522b
2 changed files with 10 additions and 0 deletions

View file

@ -17,6 +17,8 @@
* Allow client connection timeout to be set #108
* Allow to use std::net::TcpListener for HttpServer
## 0.4.4 (2018-03-04)

View file

@ -173,6 +173,14 @@ impl<H> HttpServer<H> where H: IntoHttpHandler + 'static
self.sockets.keys().cloned().collect()
}
/// Use listener for accepting incoming connection requests
///
/// HttpServer does not change any configuration for TcpListener,
/// it needs to be configured before passing it to listen() method.
pub fn listen(mut self, lst: net::TcpListener) {
self.sockets.insert(lst.local_addr().unwrap(), lst);
}
/// The socket address to bind
///
/// To mind multiple addresses this method can be call multiple times.