Closed indykish closed 6 years ago
The example, does it compile ?
In the following code, we couldn't locate the method accept_async in ServerConfig ? in rusttls crate ?
accept_async
ServerConfig
rusttls
Is there something missing ?
let mut config = ServerConfig::new(NoClientAuth::new()); config.set_single_cert(load_certs(cert_file), load_keys(key_file).remove(0)); let arc_config = Arc::new(config); let socket = TcpListener::bind(&addr, &handle).unwrap(); let done = socket.incoming() .for_each(|(stream, addr)| if flag_echo { let done = arc_config.accept_async(stream) .and_then(|stream| { let (reader, writer) = stream.split(); io::copy(reader, writer) }) .map(move |(n, ..)| println!("Echo: {} - {}", n, addr)) .map_err(move |err| println!("Error: {:?} - {}", err, addr)); handle.spawn(done); Ok(())
Are you guys using a nightly rustls crate ?
rustls
you need use tokio_rustls::ServerConfigExt;.
use tokio_rustls::ServerConfigExt;
Ok. thanks.
The example, does it compile ?
In the following code, we couldn't locate the method
accept_async
inServerConfig
? inrusttls
crate ?Is there something missing ?