Fabcoin Core  0.16.2
P2P Digital Currency
Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
dev::p2p::RLPXSocketIO Class Reference

#include <RLPXSocketIO.h>

Inheritance diagram for dev::p2p::RLPXSocketIO:
[legend]
Collaboration diagram for dev::p2p::RLPXSocketIO:
[legend]

Public Member Functions

 RLPXSocketIO (unsigned _protCount, RLPXFrameCoder &_coder, bi::tcp::socket &_socket, bool _flowControl=true, size_t _initialCapacity=DefaultInitialCapacity)
 
void send (unsigned _protocolType, unsigned _type, RLPStream &_payload)
 
void doWrite ()
 

Static Public Attributes

static uint32_t const MinFrameSize = h128::size * 3
 
static uint32_t const MaxPacketSize = 1 << 24
 
static uint16_t const DefaultInitialCapacity = 8 << 8
 

Private Member Functions

void deferWrite ()
 
void write (size_t _dequed)
 

Static Private Member Functions

static std::vector< RLPXFrameWriterwriters (unsigned _capacity)
 

Private Attributes

bool const m_flowControl
 True if flow control is enabled. More...
 
RLPXFrameCoderm_coder
 Encoder/decoder of frame payloads. More...
 
bi::tcp::socket & m_socket
 
std::deque< bytesm_toSend
 Reusable byte buffer for pending socket writes. More...
 
std::vector< RLPXFrameWriterm_writers
 Write queues for each protocol. TODO: map to bytes (of capability) More...
 
std::unique_ptr< ba::deadline_timer > m_congestion
 Scheduled when writes are deferred due to congestion. More...
 
Mutex x_queued
 
unsigned m_queued = 0
 Track total queued packets to ensure single write loop. More...
 
uint32_t m_egressCapacity
 

Detailed Description

Definition at line 33 of file RLPXSocketIO.h.

Constructor & Destructor Documentation

RLPXSocketIO::RLPXSocketIO ( unsigned  _protCount,
RLPXFrameCoder _coder,
bi::tcp::socket &  _socket,
bool  _flowControl = true,
size_t  _initialCapacity = DefaultInitialCapacity 
)

Definition at line 33 of file RLPXSocketIO.cpp.

Member Function Documentation

void RLPXSocketIO::deferWrite ( )
private

Definition at line 85 of file RLPXSocketIO.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RLPXSocketIO::doWrite ( )

Definition at line 61 of file RLPXSocketIO.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void RLPXSocketIO::send ( unsigned  _protocolType,
unsigned  _type,
RLPStream _payload 
)

Definition at line 49 of file RLPXSocketIO.cpp.

Here is the call graph for this function:

void RLPXSocketIO::write ( size_t  _dequed)
private

Definition at line 93 of file RLPXSocketIO.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

vector< RLPXFrameWriter > RLPXSocketIO::writers ( unsigned  _capacity)
staticprivate

Definition at line 41 of file RLPXSocketIO.cpp.

Member Data Documentation

uint16_t const RLPXSocketIO::DefaultInitialCapacity = 8 << 8
static

Definition at line 38 of file RLPXSocketIO.h.

RLPXFrameCoder& dev::p2p::RLPXSocketIO::m_coder
private

Encoder/decoder of frame payloads.

Definition at line 55 of file RLPXSocketIO.h.

std::unique_ptr<ba::deadline_timer> dev::p2p::RLPXSocketIO::m_congestion
private

Scheduled when writes are deferred due to congestion.

Definition at line 61 of file RLPXSocketIO.h.

uint32_t dev::p2p::RLPXSocketIO::m_egressCapacity
private

Definition at line 65 of file RLPXSocketIO.h.

bool const dev::p2p::RLPXSocketIO::m_flowControl
private

True if flow control is enabled.

Definition at line 53 of file RLPXSocketIO.h.

unsigned dev::p2p::RLPXSocketIO::m_queued = 0
private

Track total queued packets to ensure single write loop.

Definition at line 64 of file RLPXSocketIO.h.

bi::tcp::socket& dev::p2p::RLPXSocketIO::m_socket
private

Definition at line 56 of file RLPXSocketIO.h.

std::deque<bytes> dev::p2p::RLPXSocketIO::m_toSend
private

Reusable byte buffer for pending socket writes.

Definition at line 58 of file RLPXSocketIO.h.

std::vector<RLPXFrameWriter> dev::p2p::RLPXSocketIO::m_writers
private

Write queues for each protocol. TODO: map to bytes (of capability)

Definition at line 60 of file RLPXSocketIO.h.

uint32_t const RLPXSocketIO::MaxPacketSize = 1 << 24
static

Definition at line 37 of file RLPXSocketIO.h.

uint32_t const RLPXSocketIO::MinFrameSize = h128::size * 3
static

Definition at line 36 of file RLPXSocketIO.h.

Mutex dev::p2p::RLPXSocketIO::x_queued
private

Definition at line 63 of file RLPXSocketIO.h.


The documentation for this class was generated from the following files: