ark::comms::HttpOutgoingBuffer

Defined in header “ark/comms/http_buffer.hh”.


This class represents an outgoing buffer it is really a collection of buffers internally, and we use it to store information if we are falling behind when writing data to clients.

Methods

  • void push(const void * content, size_t size)
    Pushes the given bytes onto the stack. These bytes will be copied into a new byte buffer.

  • void push(const ark::core::ByteBuffer & buffer, size_t offset)
    Pushes a new byte buffer onto the stack. The offset is the amount of bytes written to date. If you do not own this buffer, a copy will be made.

  • core::ByteBuffer peek()
    Returns a wrapped byte buffer containing the next set of bytes that need to be transmitted. Throws if there is nothing left to see.

  • void pop(size_t byte_count)
    Pops the given number of bytes from the next buffer. This should never exceed the number of bytes received from a peek() call. It is intended to pop() at most the bytes received from peek().

  • size_t bytes_to_send()
    Total amount of outstanding data to send.