CatapultServer
v0.5.0.1 (Elephant)
|
Helper for extracting a packet from a working buffer. More...
Public Member Functions | |
PacketExtractor (ByteBuffer &data, size_t maxPacketDataSize) | |
PacketExtractResult | tryExtractNextPacket (const Packet *&pExtractedPacket) |
Tries to extract the next packet into (pExtractedPacket). More... | |
void | consume () |
Marks all extracted packets as consumed and deletes their backing memory. More... | |
Private Attributes | |
ByteBuffer & | m_data |
size_t | m_maxPacketDataSize |
size_t | m_consumedBytes |
Helper for extracting a packet from a working buffer.
catapult::ionet::PacketExtractor::PacketExtractor | ( | ByteBuffer & | data, |
size_t | maxPacketDataSize | ||
) |
Creates a packet extractor for extracting a packet from data that allows a maximum packet data size of maxPacketDataSize.
void catapult::ionet::PacketExtractor::consume | ( | ) |
Marks all extracted packets as consumed and deletes their backing memory.
PacketExtractResult catapult::ionet::PacketExtractor::tryExtractNextPacket | ( | const Packet *& | pExtractedPacket | ) |
Tries to extract the next packet into (pExtractedPacket).
|
private |
|
private |
|
private |