The Session class.
More...
#include <Session.h>
The Session class.
- Todo:
- Document fully.
Definition at line 90 of file Session.h.
void dev::p2p::Session::addNote |
( |
std::string const & |
_k, |
|
|
std::string const & |
_v |
|
) |
| |
|
inlineoverridevirtual |
void Session::addRating |
( |
int |
_r | ) |
|
|
overridevirtual |
std::map<CapDesc, std::shared_ptr<Capability> > const& dev::p2p::Session::capabilities |
( |
| ) |
const |
|
inlineoverridevirtual |
- Returns
- true iff the _msg forms a valid message for sending or receiving on the network.
Definition at line 209 of file Session.cpp.
bool Session::checkRead |
( |
std::size_t |
_expected, |
|
|
boost::system::error_code |
_ec, |
|
|
std::size_t |
_length |
|
) |
| |
|
private |
Check error code after reading and drop peer if error code.
Definition at line 452 of file Session.cpp.
std::chrono::steady_clock::time_point dev::p2p::Session::connectionTime |
( |
| ) |
|
|
inlineoverridevirtual |
Perform a read on the socket.
read padded frame and mac
Definition at line 374 of file Session.cpp.
void Session::doReadFrames |
( |
| ) |
|
|
private |
Drop the connection for the reason _r.
Definition at line 327 of file Session.cpp.
bool dev::p2p::Session::isConnected |
( |
| ) |
const |
|
inlineoverridevirtual |
static bool dev::p2p::Session::isFramingAllowedForVersion |
( |
unsigned |
_version | ) |
|
|
inlinestatic |
bool dev::p2p::Session::isFramingEnabled |
( |
| ) |
const |
|
inlineprivate |
std::chrono::steady_clock::time_point dev::p2p::Session::lastReceived |
( |
| ) |
const |
|
inlineoverridevirtual |
unsigned dev::p2p::Session::maxFrameSize |
( |
| ) |
const |
|
inlineprivate |
void Session::multiplexAll |
( |
| ) |
|
|
private |
std::shared_ptr<Peer> dev::p2p::Session::peer |
( |
| ) |
const |
|
inlineoverridevirtual |
int Session::rating |
( |
| ) |
const |
|
overridevirtual |
bool Session::readPacket |
( |
uint16_t |
_capId, |
|
|
PacketType |
_t, |
|
|
RLP const & |
_r |
|
) |
| |
|
private |
void Session::registerCapability |
( |
CapDesc const & |
_desc, |
|
|
std::shared_ptr< Capability > |
_p |
|
) |
| |
|
overridevirtual |
void Session::registerFraming |
( |
uint16_t |
_id | ) |
|
|
overridevirtual |
void Session::sealAndSend |
( |
RLPStream & |
_s, |
|
|
uint16_t |
_protocolID |
|
) |
| |
|
overridevirtual |
void Session::send |
( |
bytes && |
_msg, |
|
|
uint16_t |
_protocolID |
|
) |
| |
|
private |
Perform a single round of the write operation. This could end up calling itself asynchronously.
Definition at line 258 of file Session.cpp.
void Session::writeFrames |
( |
| ) |
|
|
private |
The peer's capability set.
Definition at line 175 of file Session.h.
std::chrono::steady_clock::time_point dev::p2p::Session::m_connect |
|
private |
Time point of connection.
Definition at line 171 of file Session.h.
std::vector<byte> dev::p2p::Session::m_data |
|
private |
Buffer for ingress packet data.
Definition at line 162 of file Session.h.
bool dev::p2p::Session::m_dropped = false |
|
private |
If true, we've already divested ourselves of this peer. We're just waiting for the reads & writes to fail before the shared_ptr goes OOS and the destructor kicks in.
Definition at line 166 of file Session.h.
std::deque<bytes> dev::p2p::Session::m_encFrames |
|
private |
std::map<uint16_t, std::shared_ptr<Framing> > dev::p2p::Session::m_framing |
|
private |
bytes dev::p2p::Session::m_incoming |
|
private |
Read buffer for ingress bytes.
Definition at line 163 of file Session.h.
Dynamic information about this peer.
Definition at line 169 of file Session.h.
Transport over which packets are sent.
Definition at line 158 of file Session.h.
std::chrono::steady_clock::time_point dev::p2p::Session::m_lastReceived |
|
private |
Time point of last message.
Definition at line 173 of file Session.h.
std::shared_ptr<Peer> dev::p2p::Session::m_peer |
|
private |
std::chrono::steady_clock::time_point dev::p2p::Session::m_ping |
|
private |
Time point of last ping.
Definition at line 172 of file Session.h.
Host* dev::p2p::Session::m_server |
|
private |
The host that owns us. Never null.
Definition at line 156 of file Session.h.
std::shared_ptr<RLPXSocket> dev::p2p::Session::m_socket |
|
private |
Socket of peer's connection.
Definition at line 159 of file Session.h.
std::deque<bytes> dev::p2p::Session::m_writeQueue |
|
private |
Mutex dev::p2p::Session::x_framing |
|
private |
Mutex for the write queue.
Definition at line 160 of file Session.h.
Mutex dev::p2p::Session::x_info |
|
mutableprivate |
The documentation for this class was generated from the following files: