1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-28 06:20:36 +02:00

Connector::Response returns addr and tcp stream

This commit is contained in:
Nikolay Kim
2018-08-27 14:20:41 -07:00
parent 3dbaef3ec1
commit c69d675113
4 changed files with 27 additions and 25 deletions

View File

@ -43,7 +43,7 @@ fn main() {
.unwrap();
let num = Arc::new(AtomicUsize::new(0));
let openssl = ssl::OpensslService::new(builder);
let openssl = ssl::OpensslAcceptor::new(builder);
// server start mutiple workers, it runs supplied `Fn` in each worker.
Server::default()
@ -51,9 +51,12 @@ fn main() {
let num = num.clone();
// configure service
openssl.clone().and_then((service, move || {
Ok::<_, io::Error>(ServiceState { num: num.clone() })
}))
openssl
.clone()
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))
.and_then((service, move || {
Ok::<_, io::Error>(ServiceState { num: num.clone() })
}))
}).unwrap()
.start();