CatapultServer  v0.5.0.1 (Elephant)
catapult::net::PacketWriters Class Referenceabstract

Manages a collection of connections that send data to external nodes. More...

Inheritance diagram for catapult::net::PacketWriters:
Collaboration diagram for catapult::net::PacketWriters:

Public Types

using ConnectCallback = consumer< const PeerConnectResult & >
 

Public Member Functions

virtual size_t numActiveWriters () const =0
 Gets the number of active writers. More...
 
virtual size_t numAvailableWriters () const =0
 
virtual void broadcast (const ionet::PacketPayload &payload)=0
 Broadcasts payload to all active connections. More...
 
virtual void connect (const ionet::Node &node, const ConnectCallback &callback)=0
 Attempts to connect to node and calls callback on completion. More...
 
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. More...
 
virtual void shutdown ()=0
 Shuts down all connections. More...
 
- Public Member Functions inherited from catapult::net::ConnectionContainer
virtual ~ConnectionContainer ()=default
 
virtual size_t numActiveConnections () const =0
 Gets the number of active connections (including pending connections). More...
 
virtual utils::KeySet identities () const =0
 Gets the identities of active connections. More...
 
virtual bool closeOne (const Key &identityKey)=0
 Closes any active connections to the node identified by identityKey. More...
 
- Public Member Functions inherited from catapult::net::PacketIoPicker
virtual ~PacketIoPicker ()=default
 
virtual ionet::NodePacketIoPair pickOne (const utils::TimeSpan &ioDuration)=0
 

Detailed Description

Manages a collection of connections that send data to external nodes.

Member Typedef Documentation

◆ ConnectCallback

Member Function Documentation

◆ accept()

virtual void catapult::net::PacketWriters::accept ( const std::shared_ptr< ionet::PacketSocket > &  pAcceptedSocket,
const ConnectCallback callback 
)
pure virtual

Accepts a connection represented by pAcceptedSocket and calls callback on completion.

◆ broadcast()

virtual void catapult::net::PacketWriters::broadcast ( const ionet::PacketPayload payload)
pure virtual

Broadcasts payload to all active connections.

◆ connect()

virtual void catapult::net::PacketWriters::connect ( const ionet::Node node,
const ConnectCallback callback 
)
pure virtual

Attempts to connect to node and calls callback on completion.

◆ numActiveWriters()

virtual size_t catapult::net::PacketWriters::numActiveWriters ( ) const
pure virtual

Gets the number of active writers.

◆ numAvailableWriters()

virtual size_t catapult::net::PacketWriters::numAvailableWriters ( ) const
pure virtual

Gets the number of available writers.

Note
There will be fewer available writers than active writers when some writers are checked out.

◆ shutdown()

virtual void catapult::net::PacketWriters::shutdown ( )
pure virtual

Shuts down all connections.


The documentation for this class was generated from the following file: