CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
29 namespace crypto {
class KeyPair; }
34 namespace net {
struct Packet; }
35 namespace thread {
class IoThreadPool; }
62 virtual void accept(
const std::shared_ptr<ionet::PacketSocket>& pAcceptedSocket,
const ConnectCallback& callback) = 0;
71 const std::shared_ptr<thread::IoThreadPool>& pPool,
virtual void connect(const ionet::Node &node, const ConnectCallback &callback)=0
Attempts to connect to node and calls callback on completion.
void erase(iterator position)
Removes a single element at position from the container.
Definition: ModificationSafeIterableContainer.h:110
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
std::shared_ptr< ClientConnector > CreateClientConnector(const std::shared_ptr< thread::IoThreadPool > &pPool, const crypto::KeyPair &keyPair, const ConnectionSettings &settings)
Creates a client connector for a server with a key pair of keyPair using pPool and configured with se...
Definition: ClientConnector.cpp:104
Manages a collection of connections that send data to external nodes.
Definition: PacketWriters.h:41
def debug(*args)
Definition: Parser.py:46
Settings used to configure connections.
Definition: ConnectionSettings.h:31
size_t size() const
Gets the number of elements in the container.
Definition: ModificationSafeIterableContainer.h:35
std::shared_ptr< ClientConnector > m_pClientConnector
Definition: PacketWriters.cpp:418
value_type * nextIf(TPredicate predicate)
Definition: ModificationSafeIterableContainer.h:82
def warning(*args)
Definition: colorPrint.py:10
std::shared_ptr< ServerConnector > CreateServerConnector(const std::shared_ptr< thread::IoThreadPool > &pPool, const crypto::KeyPair &keyPair, const ConnectionSettings &settings)
Creates a server connector for a server with a key pair of keyPair using pPool and configured with se...
Definition: ServerConnector.cpp:119
ErrorCallback m_errorCallback
Definition: PacketWriters.cpp:250
virtual void broadcast(const ionet::PacketPayload &payload)=0
Broadcasts payload to all active connections.
std::shared_ptr< ionet::PacketIo > m_pPacketIo
Definition: PacketWriters.cpp:247
SocketOperationCode
Enumeration of socket operation results.
Definition: SocketOperationCode.h:50
net::PacketWriters & PacketWriters
Definition: PeersConnectionTasks.cpp:105
std::shared_ptr< ionet::PacketIo > pBufferedIo
Definition: PacketWriters.cpp:47
Represents a pair of private key with associated public key.
Definition: KeyPair.h:33
utils::KeySet m_nodeIdentityKeys
Definition: PacketWriters.cpp:197
std::shared_ptr< ServerConnector > m_pServerConnector
Definition: PacketWriters.cpp:419
typename TContainer::iterator iterator
Definition: ModificationSafeIterableContainer.h:31
virtual size_t numActiveWriters() const =0
Gets the number of active writers.
Writers m_writers
Definition: PacketWriters.cpp:199
ArraySet< Key > KeySet
A key set.
Definition: ArraySet.h:64
uint64_t size
Definition: MemoryCounters.cpp:65
utils::SpinLock m_lock
Definition: PacketWriters.cpp:200
virtual size_t numAvailableWriters() const =0
std::function< void()> action
An action function.
Definition: functions.h:27
consumer< const PeerConnectResult & > ConnectCallback
Definition: PacketWriters.h:43
auto cbegin() const
Returns a const iterator that represents the first entity.
Definition: ModificationSafeIterableContainer.h:46
std::shared_ptr< thread::IoThreadPool > m_pPool
Definition: PacketWriters.cpp:417
Manages a collection of connections.
Definition: ConnectionContainer.h:27
auto end()
Returns an iterator that represents one past the last entity.
Definition: ModificationSafeIterableContainer.h:61
An interface for picking packet io pairs.
Definition: PacketIoPicker.h:30
CompletionCallback m_completionCallback
Definition: PacketWriters.cpp:251
#define CATAPULT_LOG_THROTTLE(LEVEL, THROTTLE_MILLIS)
Definition: ThrottleLogger.h:76
std::shared_ptr< PacketWriters > CreatePacketWriters(const std::shared_ptr< thread::IoThreadPool > &pPool, const crypto::KeyPair &keyPair, const ConnectionSettings &settings)
Definition: PacketWriters.cpp:425
utils::KeySet m_outgoingNodeIdentityKeys
Definition: PacketWriters.cpp:198
model::NetworkIdentifier m_networkIdentifier
Definition: PacketWriters.cpp:420
void clear()
Removes all elements from the container.
Definition: ModificationSafeIterableContainer.h:122
SocketPointer pSocket
Definition: PacketWriters.cpp:46
ionet::Node Node
Definition: PacketWriters.cpp:45
A packet payload that can be written.
Definition: PacketPayload.h:29
Definition: AddressExtractionExtension.cpp:28
auto cend() const
Returns a const iterator that represents one past the last entity.
Definition: ModificationSafeIterableContainer.h:51
bool IsAvailable
Definition: PacketWriters.cpp:44
virtual void accept(const std::shared_ptr< ionet::PacketSocket > &pAcceptedSocket, const ConnectCallback &callback)=0
Accepts a connection represented by pAcceptedSocket and calls callback on completion.
A node in the catapult network.
Definition: Node.h:82
std::function< void(TArgs...)> consumer
A consumer function.
Definition: functions.h:35
void push_back(const value_type &value)
Adds a new element at the end of the container.
Definition: ModificationSafeIterableContainer.h:101
utils::ByteArray< Key_Size, Key_tag > Key
Definition: src/catapult/types.h:41
std::lock_guard< SpinLock > SpinLockGuard
A spin lock guard.
Definition: SpinLock.h:60
virtual void shutdown()=0
Shuts down all connections.
auto begin()
Returns an iterator that represents the first entity.
Definition: ModificationSafeIterableContainer.h:56