CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
24 namespace catapult {
namespace thread {
class IoThreadPool; } }
81 const std::shared_ptr<thread::IoThreadPool>& pPool,
82 const boost::asio::ip::tcp::endpoint& endpoint,
ionet::PacketSocketOptions PacketSocketOptions
Packet socket options.
Definition: AsyncTcpServer.h:46
consumer< ionet::socket & > ConfigureSocketHandler
Definition: AsyncTcpServer.h:30
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
std::atomic_bool m_isStopped
Definition: AsyncTcpServer.cpp:204
ionet::PacketSocketOptions toSocketOptions() const
Gets the packet socket options represented by the configured settings.
Definition: ConnectionSettings.h:68
virtual uint32_t numCurrentConnections() const =0
Current number of active connections.
def debug(*args)
Definition: Parser.py:46
Settings used to configure connections.
Definition: ConnectionSettings.h:31
virtual uint32_t numPendingAccepts() const =0
Number of asynchronously started (but not completed) socket accepts.
std::shared_ptr< thread::IoThreadPool > m_pPool
Definition: AsyncTcpServer.cpp:199
uint16_t MaxPendingConnections
Definition: AsyncTcpServer.h:49
bool AllowAddressReuse
true if the server should reuse ports already in use.
Definition: AsyncTcpServer.h:55
const AsyncTcpServerSettings m_settings
Definition: AsyncTcpServer.cpp:203
An async TCP server.
Definition: AsyncTcpServer.h:59
boost::asio::io_context::strand m_acceptorStrand
Definition: AsyncTcpServer.cpp:200
std::atomic< uint32_t > m_numPendingAccepts
Definition: AsyncTcpServer.cpp:205
AsyncTcpServerSettings(const AcceptHandler &accept)
Creates a structure with a preconfigured accept handler (accept).
Definition: AsyncTcpServer.cpp:211
virtual void shutdown()=0
Shuts down the server.
virtual ~AsyncTcpServer()=default
consumer< const ionet::AcceptedPacketSocketInfo & > AcceptHandler
Definition: AsyncTcpServer.h:28
std::atomic< uint32_t > m_numCurrentConnections
Definition: AsyncTcpServer.cpp:206
virtual uint32_t numLifetimeConnections() const =0
Total number of connections during the server's lifetime.
def info(*args)
Definition: forwardsValidation.py:12
std::shared_ptr< AsyncTcpServer > CreateAsyncTcpServer(const std::shared_ptr< thread::IoThreadPool > &pPool, const boost::asio::ip::tcp::endpoint &endpoint, const AsyncTcpServerSettings &settings)
Definition: AsyncTcpServer.cpp:217
void Accept(boost::asio::ip::tcp::acceptor &acceptor, const PacketSocketOptions &options, const ConfigureSocketCallback &configureSocket, const AcceptCallback &accept)
Definition: PacketSocket.cpp:377
ConfigureSocketHandler ConfigureSocket
Definition: AsyncTcpServer.h:43
uint32_t MaxActiveConnections
Definition: AsyncTcpServer.h:52
Settings used to configure AsyncTcpServer behavior.
Definition: AsyncTcpServer.h:33
SocketPointer pSocket
Definition: PacketWriters.cpp:46
Definition: AddressExtractionExtension.cpp:28
Packet socket options.
Definition: PacketSocketOptions.h:27
boost::asio::ip::tcp::acceptor m_acceptor
Definition: AsyncTcpServer.cpp:201
const AcceptHandler Accept
Accept handler (must be set via constructor).
Definition: AsyncTcpServer.h:40
std::function< void(TArgs...)> consumer
A consumer function.
Definition: functions.h:35
std::atomic< uint32_t > m_numLifetimeConnections
Definition: AsyncTcpServer.cpp:207