#include <sync_protocol_impl.hpp>
|
| SyncProtocolImpl (libp2p::Host &host, const application::ChainSpec &chain_spec, std::shared_ptr< SyncProtocolObserver > sync_observer, std::shared_ptr< ReputationRepository > reputation_repository) |
|
bool | start () override |
|
bool | stop () override |
|
const std::string & | protocolName () const override |
|
void | onIncomingStream (std::shared_ptr< Stream > stream) override |
|
void | newOutgoingStream (const PeerInfo &peer_info, std::function< void(outcome::result< std::shared_ptr< Stream >>)> &&cb) override |
|
void | request (const PeerId &peer_id, BlocksRequest block_request, std::function< void(outcome::result< BlocksResponse >)> &&response_handler) override |
| Make async request to peer and return response in callback. More...
|
|
void | readRequest (std::shared_ptr< Stream > stream) |
|
void | writeResponse (std::shared_ptr< Stream > stream, const BlocksResponse &block_response) |
|
void | writeRequest (std::shared_ptr< Stream > stream, BlocksRequest block_request, std::function< void(outcome::result< void >)> &&cb) |
|
void | readResponse (std::shared_ptr< Stream > stream, std::function< void(outcome::result< BlocksResponse >)> &&response_handler) |
|
| ProtocolBase ()=default |
|
| ProtocolBase (ProtocolBase &&) noexcept=delete |
|
| ProtocolBase (const ProtocolBase &)=delete |
|
virtual | ~ProtocolBase ()=default |
|
ProtocolBase & | operator= (ProtocolBase &&) noexcept=delete |
|
ProtocolBase & | operator= (ProtocolBase const &)=delete |
|
Definition at line 101 of file sync_protocol_impl.hpp.
void kagome::network::SyncProtocolImpl::newOutgoingStream |
( |
const PeerInfo & |
peer_info | ) |
|
|
overridevirtual |
void kagome::network::SyncProtocolImpl::onIncomingStream |
( |
std::shared_ptr< Stream > |
stream | ) |
|
|
overridevirtual |
const std::string& kagome::network::SyncProtocolImpl::protocolName |
( |
| ) |
const |
|
inlineoverridevirtual |
void kagome::network::SyncProtocolImpl::readRequest |
( |
std::shared_ptr< Stream > |
stream | ) |
|
void kagome::network::SyncProtocolImpl::readResponse |
( |
std::shared_ptr< Stream > |
stream, |
|
|
std::function< void(outcome::result< BlocksResponse >)> && |
response_handler |
|
) |
| |
void kagome::network::SyncProtocolImpl::request |
( |
const PeerId & |
peer_id, |
|
|
BlocksRequest |
block_request, |
|
|
std::function< void(outcome::result< BlocksResponse >)> && |
response_handler |
|
) |
| |
|
overridevirtual |
Make async request to peer and return response in callback.
- Parameters
-
peer_id | of a peer to make request to |
block_request | a request content |
response_handler | a callback to call when response received |
Implements kagome::network::SyncProtocol.
Definition at line 409 of file sync_protocol_impl.cpp.
bool kagome::network::SyncProtocolImpl::start |
( |
| ) |
|
|
overridevirtual |
bool kagome::network::SyncProtocolImpl::stop |
( |
| ) |
|
|
overridevirtual |
void kagome::network::SyncProtocolImpl::writeRequest |
( |
std::shared_ptr< Stream > |
stream, |
|
|
BlocksRequest |
block_request, |
|
|
std::function< void(outcome::result< void >)> && |
cb |
|
) |
| |
void kagome::network::SyncProtocolImpl::writeResponse |
( |
std::shared_ptr< Stream > |
stream, |
|
|
const BlocksResponse & |
block_response |
|
) |
| |
const auto kagome::network::SyncProtocolImpl::kSyncProtocolName = "SyncProtocol"s |
|
inlinestaticprivate |
The documentation for this class was generated from the following files: