TARAXA
|
The Capability interface. This interface has to be implemented to support any devp2p subprotocol. More...
#include <Capability.h>
Public Member Functions | |
virtual | ~CapabilityFace ()=default |
virtual std::string | name () const =0 |
Subprotocol name, used in negotiating common capabilities with the peers. | |
virtual unsigned | version () const =0 |
virtual unsigned | messageCount () const =0 |
Number of messages supported by the subprotocol version. | |
virtual std::string | packetTypeToString (unsigned _packetType) const =0 |
Convert supplied packet type to string - used for logging purposes. | |
virtual void | onConnect (std::weak_ptr< Session > session, u256 const &_peerCapabilityVersion)=0 |
virtual void | interpretCapabilityPacket (std::weak_ptr< Session > session, unsigned packet_type, RLP const &payload)=0 |
virtual void | onDisconnect (NodeID const &_nodeID)=0 |
The Capability interface. This interface has to be implemented to support any devp2p subprotocol.
|
virtualdefault |
|
pure virtual |
Called by the Host when the messaege is received from the peer
Implemented in taraxa::network::tarcap::TaraxaCapability.
Number of messages supported by the subprotocol version.
Implemented in taraxa::network::tarcap::TaraxaCapability.
|
pure virtual |
Subprotocol name, used in negotiating common capabilities with the peers.
Implemented in taraxa::network::tarcap::TaraxaCapability.
|
pure virtual |
Called by the Host when new peer is connected. Guaranteed to be called first before any interpretCapabilityPacket for this peer.
Called by the Host when the peer is disconnected. Guaranteed to be called last after any interpretCapabilityPacket for this peer.
Implemented in taraxa::network::tarcap::TaraxaCapability.
|
pure virtual |
Convert supplied packet type to string - used for logging purposes.
Implemented in taraxa::network::tarcap::TaraxaCapability.
Subprotocol version, used in negotiating common capabilities with the peers.
Implemented in taraxa::network::tarcap::TaraxaCapability.