facebook / wangle

Wangle is a framework providing a set of common client/server abstractions for building services in a consistent, modular, and composable way.
Apache License 2.0
3.05k stars 539 forks source link

Binary protocol example #79

Closed kirillv closed 7 years ago

kirillv commented 7 years ago

Hi all. Interested in this framework, but im a little bit confused how to parse binary messages (custom protocol etc) in proper "wangle" way). It would be cool if it would appear in example folder. Currently im using asio and everything ok, but as i can see wangle has more then 1 person behind (compare to asio). Thanks in advance!

anirudhvr commented 7 years ago

The recommended way is to use folly::IOBuf and folly::Cursor. Here is an example of how we parse a TLS ClientHello message

https://github.com/facebook/folly/blob/master/folly/io/async/AsyncSSLSocket.cpp#L1648-L1735