A pluggable network subsystem. More...
#include <peer_network.h>
Public Member Functions | |
| virtual | ~Subsystem ()=default |
| virtual void | attach (NodeContext &ctx)=0 |
| virtual void | start ()=0 |
| virtual void | stop ()=0 |
A pluggable network subsystem.
Owns its own threads/sockets if it needs them; reaches the rest of the node only through the NodeContext it is attached to (the peer mesh via ctx.network, host events via ctx.events, sibling modules via ctx.services). A subsystem is mocked in tests by faking those interfaces.
attach() is called once, at the first start() after the subsystem was added; start() and stop() then pair up for every run of a node that is restarted.
Definition at line 176 of file peer_network.h.
|
virtualdefault |
|
pure virtual |
Implemented in librats::Bittorrent, librats::DhtDiscovery, librats::FileTransfer, librats::HolePunch, librats::MdnsDiscovery, librats::MessageJson, librats::PeerExchange, librats::PingService, librats::PortMappingService, librats::PubSub, librats::ReconnectionService, librats::Relay, and librats::StorageManager.
|
pure virtual |
Implemented in librats::Bittorrent, librats::DhtDiscovery, librats::FileTransfer, librats::HolePunch, librats::MdnsDiscovery, librats::MessageJson, librats::PeerExchange, librats::PingService, librats::PortMappingService, librats::PubSub, librats::ReconnectionService, librats::Relay, and librats::StorageManager.
|
pure virtual |
Implemented in librats::Bittorrent, librats::DhtDiscovery, librats::FileTransfer, librats::HolePunch, librats::MdnsDiscovery, librats::MessageJson, librats::PeerExchange, librats::PingService, librats::PortMappingService, librats::PubSub, librats::ReconnectionService, librats::Relay, and librats::StorageManager.