33 class RLPXSocketIO:
public std::enable_shared_from_this<RLPXSocketIO>
40 RLPXSocketIO(
unsigned _protCount,
RLPXFrameCoder& _coder, bi::tcp::socket& _socket,
bool _flowControl =
true,
size_t _initialCapacity = DefaultInitialCapacity);
42 void send(
unsigned _protocolType,
unsigned _type,
RLPStream& _payload);
47 static std::vector<RLPXFrameWriter>
writers(
unsigned _capacity);
51 void write(
size_t _dequed);
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
static std::vector< RLPXFrameWriter > writers(unsigned _capacity)
std::deque< bytes > m_toSend
Reusable byte buffer for pending socket writes.
unsigned m_queued
Track total queued packets to ensure single write loop.
RLPXSocketIO(unsigned _protCount, RLPXFrameCoder &_coder, bi::tcp::socket &_socket, bool _flowControl=true, size_t _initialCapacity=DefaultInitialCapacity)
std::unique_ptr< ba::deadline_timer > m_congestion
Scheduled when writes are deferred due to congestion.
std::vector< RLPXFrameWriter > m_writers
Write queues for each protocol. TODO: map to bytes (of capability)
void send(unsigned _protocolType, unsigned _type, RLPStream &_payload)
bi::tcp::socket & m_socket
static uint32_t const MinFrameSize
bool const m_flowControl
True if flow control is enabled.
static uint16_t const DefaultInitialCapacity
void write(size_t _dequed)
RLPXFrameCoder & m_coder
Encoder/decoder of frame payloads.
uint32_t m_egressCapacity
Class for writing to an RLP bytestream.
Encoder/decoder transport for RLPx connection established by RLPXHandshake.
static uint32_t const MaxPacketSize