async-rs / async-tls

A TLS implementation over AsyncRead and AsyncWrite
https://async.rs
Apache License 2.0
165 stars 47 forks source link

Make TlsStream cloneable #18

Open NyxCode opened 4 years ago

NyxCode commented 4 years ago

async_std::net::TcpStream implements Clone, which makes it possible to read and write to a socket at the same time. Official async-std example This library does not implement Clone for TlsStream, neither does it implement AsyncRead or AsyncWrite for &TlsStream. How would I rewrite the example above to use TLS when TlsStream is not clonable?

abhishekc-sharma commented 4 years ago

@yoshuawuyts Correct me if I'm wrong but one of the changes suggested by @NyxCode above would need to be implemented to apply either of the solutions suggested in https://github.com/http-rs/async-h1/issues/74