|
proxygen
|
#include <FixedLengthFrameDecoder.h>
Public Member Functions | |
| FixedLengthFrameDecoder (size_t length) | |
| bool | decode (Context *, folly::IOBufQueue &q, std::unique_ptr< folly::IOBuf > &result, size_t &needed) override |
Public Member Functions inherited from wangle::ByteToMessageDecoder< M > | |
| virtual bool | decode (Context *ctx, folly::IOBufQueue &buf, M &result, size_t &)=0 |
| void | transportActive (Context *ctx) override |
| void | transportInactive (Context *ctx) override |
| void | read (Context *ctx, folly::IOBufQueue &q) override |
Public Member Functions inherited from wangle::InboundHandler< folly::IOBufQueue &, M > | |
| ~InboundHandler () override=default | |
| virtual void | read (Context *ctx, folly::IOBufQueue &msg)=0 |
| virtual void | readEOF (Context *ctx) |
| virtual void | readException (Context *ctx, folly::exception_wrapper e) |
| virtual void | transportActive (Context *ctx) |
| virtual void | transportInactive (Context *ctx) |
Public Member Functions inherited from wangle::HandlerBase< InboundHandlerContext< M > > | |
| virtual | ~HandlerBase ()=default |
| virtual void | attachPipeline (InboundHandlerContext< M > *) |
| virtual void | detachPipeline (InboundHandlerContext< M > *) |
| InboundHandlerContext< M > * | getContext () |
Private Attributes | |
| size_t | length_ |
Additional Inherited Members | |
Public Types inherited from wangle::ByteToMessageDecoder< M > | |
| typedef InboundHandler< folly::IOBufQueue &, M >::Context | Context |
Public Types inherited from wangle::InboundHandler< folly::IOBufQueue &, M > | |
| typedef folly::IOBufQueue & | rin |
| typedef M | rout |
| typedef folly::Unit | win |
| typedef folly::Unit | wout |
| typedef InboundHandlerContext< M > | Context |
Static Public Attributes inherited from wangle::InboundHandler< folly::IOBufQueue &, M > | |
| static const HandlerDir | dir |
A decoder that splits the received IOBufs by the fixed number of bytes. For example, if you received the following four fragmented packets:
+—+-—+---—+-—+ | A | BC | DEFG | HI | +—+-—+---—+-—+
A FixedLengthFrameDecoder will decode them into the following three packets with the fixed length:
+--—+--—+--—+ | ABC | DEF | GHI | +--—+--—+--—+
Definition at line 40 of file FixedLengthFrameDecoder.h.
|
inlineexplicit |
Definition at line 42 of file FixedLengthFrameDecoder.h.
|
inlineoverride |
Definition at line 44 of file FixedLengthFrameDecoder.h.
References folly::IOBufQueue::chainLength(), length_, and folly::IOBufQueue::split().
|
private |
Definition at line 58 of file FixedLengthFrameDecoder.h.
Referenced by decode().