Improve proto::Client and proto::Server Documentation
RyanBluth opened this issue · 2 comments
RyanBluth commented
It is not clear how to integrate tokio-tls with tokio-proto
alexcrichton commented
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 typeT
, you'll usetokio_tls::proto::{Client, Server}
(depending on the context). When constructing these you'll pass infoo
(the instance of your protocol) along with aTlsConnector
orTlsAcceptor
which defines how to accept/make TLS connections. - Afterwards the resulting
Client<T>
orServer<T>
you have implements the same *Proto trait, and you can simply work with it as usual.
izderadicka commented
As tokio-proto is deprecated and was removed from tokio-tls in #45 I think this issue is not relevant any more.