1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 10:27:42 +02: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

@ -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.