class Thrift::HeaderTransport

HeaderTransport implements the THeader framing protocol.

THeader is a transport that adds headers and supports multiple protocols and transforms. It can auto-detect and communicate with legacy protocols (framed/unframed binary/compact) for backward compatibility.

Wire format:

+----------------------------------------------------------------+
| LENGTH (4 bytes, big-endian, excludes itself)                  |
+----------------------------------------------------------------+
| HEADER MAGIC (2 bytes: 0x0FFF) | FLAGS (2 bytes)               |
+----------------------------------------------------------------+
| SEQUENCE NUMBER (4 bytes)                                      |
+----------------------------------------------------------------+
| HEADER SIZE/4 (2 bytes)        | HEADER DATA (variable)...    |
+----------------------------------------------------------------+
| PAYLOAD (variable)                                             |
+----------------------------------------------------------------+