Mountain brother before and done a similar, recently I think of it, taking the time and looked at protoc-c.
Mountain brother do packet flows:
rpc -> lydtree -> motree -> struct
Many of the details involved
1) lydtree of priv hang callback, data conversion went back to the callback with the past
2) Because the stages are threaded, the data communication between threads can pass an address, the address to specialized treatment, such as a global variable or other
3) different types of data from one encoding to another encoding conversion
3) memory management, who apply, but who is going to release
Synchronous 4) threads
5) hierarchical level of transfer
6) api callback, this is a bit like a callback http_parser
7) callback registration
...
For want, protoc-c on the content of a lot less, but protoMsg -> protoBuffer conversion