tokio-rs/tokio-tls

Improve proto::Client and proto::Server Documentation

RyanBluth opened this issue · 2 comments

It is not clear how to integrate tokio-tls with tokio-proto

Sure yeah, definitely seems like we should have better examples!

In the meantime the way it works is:

  • When working with tokio-proto you'll work with some type T which implements one of the various *Proto traits (e.g. ServerProto, ClientProto, etc)
  • When working with tokio-tls you'll basically do exactly the same. Given an instance foo of type T, you'll use tokio_tls::proto::{Client, Server} (depending on the context). When constructing these you'll pass in foo (the instance of your protocol) along with a TlsConnector or TlsAcceptor which defines how to accept/make TLS connections.
  • Afterwards the resulting Client<T> or Server<T> you have implements the same *Proto trait, and you can simply work with it as usual.

As tokio-proto is deprecated and was removed from tokio-tls in #45 I think this issue is not relevant any more.