mirror of
https://github.com/actix/actix-web.git
synced 2024-11-26 11:31:09 +00:00
Allow to use std::net::TcpListener for HttpServer
This commit is contained in:
parent
24342fb745
commit
0bf29a522b
2 changed files with 10 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue