CatapultServer
v0.5.0.1 (Elephant)
|
Classes | |
class | NodeRequest |
Public Types | |
using | ResponseType = typename TRequestPolicy::ResponseType |
Remote node response type. More... | |
using | CallbackType = consumer< NodeRequestResult, const ResponseType & > |
Request completion callback type. More... | |
Public Member Functions | |
BriefServerRequestor (const std::shared_ptr< thread::IoThreadPool > &pPool, const crypto::KeyPair &keyPair, const ConnectionSettings &settings, const TResponseCompatibilityChecker &responseCompatibilityChecker) | |
size_t | numActiveConnections () const |
Gets the number of active connections. More... | |
size_t | numTotalRequests () const |
Gets the number of total requests. More... | |
size_t | numSuccessfulRequests () const |
Gets the number of successful requests. More... | |
void | beginRequest (const ionet::Node &node, const CallbackType &callback) |
Initiates a request for data from node and calls callback on completion. More... | |
void | shutdown () |
Shuts down all connections. More... | |
Private Attributes | |
std::shared_ptr< thread::IoThreadPool > | m_pPool |
TResponseCompatibilityChecker | m_responseCompatibilityChecker |
utils::TimeSpan | m_requestTimeout |
std::shared_ptr< ServerConnector > | m_pConnector |
std::atomic< size_t > | m_numTotalRequests |
std::atomic< size_t > | m_numSuccessfulRequests |
Establishes timed, short-term connections with external nodes for single requests that this (local) node initiates.
using catapult::net::BriefServerRequestor< TRequestPolicy, TResponseCompatibilityChecker >::CallbackType = consumer<NodeRequestResult, const ResponseType&> |
Request completion callback type.
using catapult::net::BriefServerRequestor< TRequestPolicy, TResponseCompatibilityChecker >::ResponseType = typename TRequestPolicy::ResponseType |
Remote node response type.
|
inline |
Creates a server requestor for a server with a key pair of keyPair using pPool and configured with settings and a custom response compatibility checker (responseCompatibilityChecker).
|
inline |
Initiates a request for data from node and calls callback on completion.
|
inline |
Gets the number of active connections.
|
inline |
Gets the number of successful requests.
|
inline |
Gets the number of total requests.
|
inline |
Shuts down all connections.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |