CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
34 namespace catapult {
namespace ionet {
59 virtual void close() = 0;
62 virtual std::shared_ptr<PacketIo>
buffered() = 0;
82 const std::string&
host()
const {
87 const std::shared_ptr<PacketSocket>&
socket()
const {
93 explicit operator bool()
const {
115 boost::asio::ip::tcp::acceptor& acceptor,
131 boost::asio::io_context& ioContext,
virtual ~PacketSocket()=default
A node's publicly accessible endpoint.
Definition: Node.h:35
std::shared_ptr< PacketSocket > m_pPacketSocket
Definition: PacketSocket.h:99
std::string m_host
Definition: PacketSocket.cpp:477
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
action Connect(boost::asio::io_context &ioContext, const PacketSocketOptions &options, const NodeEndpoint &endpoint, const ConnectCallback &callback)
Definition: PacketSocket.cpp:525
consumer< ConnectResult, const std::shared_ptr< PacketSocket > & > ConnectCallback
Callback for a connected socket.
Definition: PacketSocket.h:125
Resolver::query m_query
Definition: PacketSocket.cpp:478
thread::StrandOwnerLifetimeExtender< StrandedPacketSocket > m_strandWrapper
Definition: PacketSocket.cpp:323
size_t m_nextBufferIndex
Definition: PacketSocket.cpp:128
Resolver m_resolver
Definition: PacketSocket.cpp:476
AcceptedPacketSocketInfo()
Creates an empty info.
Definition: PacketSocket.h:71
const PacketSocket::WriteCallback m_callback
Definition: PacketSocket.cpp:127
size_t m_maxPacketDataSize
Definition: PacketSocket.cpp:243
void addServiceRegistrar(std::unique_ptr< ServiceRegistrar > &&pServiceRegistrar)
Adds a service registrar (pServiceRegistrar).
Definition: ExtensionManager.cpp:42
def warning(*args)
Definition: colorPrint.py:10
boost::asio::ip::tcp::acceptor & m_acceptor
Definition: PacketSocket.cpp:370
PLUGIN_API void RegisterExtension(catapult::extensions::ProcessBootstrapper &bootstrapper)
Entry point for registering a dynamic extension module with bootstrapper.
Definition: PacketServerExtension.cpp:35
socket m_socket
Definition: PacketSocket.cpp:240
consumer< socket & > ConfigureSocketCallback
Callback for configuring a socket before initiating an accept.
Definition: PacketSocket.h:103
ConnectResult
Enumeration of possible connection results.
Definition: ConnectResult.h:41
PacketExtractor & m_packetExtractor
Definition: PacketSocket.cpp:44
const std::string & host() const
Gets the host.
Definition: PacketSocket.h:82
consumer< SocketOperationCode > WriteCallback
Definition: PacketIo.h:34
TSocketCallbackWrapper & m_wrapper
Definition: PacketSocket.cpp:241
AcceptCallback m_accept
Definition: PacketSocket.cpp:372
SocketOperationCode
Enumeration of socket operation results.
Definition: SocketOperationCode.h:50
bool m_isCancelled
Definition: PacketSocket.cpp:479
consumer< const ionet::AcceptedPacketSocketInfo & > AcceptHandler
Definition: AsyncTcpServer.h:28
An interface for reading and writing packets.
Definition: PacketIo.h:31
constexpr bool IsPacketDataSizeValid(const PacketHeader &header, size_t maxPacketDataSize)
Determines if header indicates a valid packet data size no greater than maxPacketDataSize.
Definition: PacketHeader.h:41
boost::asio::io_context::strand m_strand
Definition: PacketSocket.cpp:322
#define PLUGIN_API
Definition: plugins.h:30
virtual std::shared_ptr< PacketIo > buffered()=0
Gets a buffered interface to the packet socket.
consumer< SocketOperationCode, const Packet * > ReadCallback
Definition: PacketIo.h:33
BasicConnectHandler< StrandedConnectHandler > m_handler
Definition: PacketSocket.cpp:520
AppendContext Context
Definition: PacketSocket.cpp:194
def info(*args)
Definition: forwardsValidation.py:12
std::string m_host
Definition: PacketSocket.h:98
AcceptedPacketSocketInfo(const std::string &host, const std::shared_ptr< PacketSocket > &pPacketSocket)
Creates an info around host and pPacketSocket.
Definition: PacketSocket.h:75
boost::asio::ip::tcp::endpoint m_endpoint
Definition: PacketSocket.cpp:480
PacketExtractResult
Possible results from PacketExtractor::tryExtractNextPacket.
Definition: PacketExtractor.h:40
boost::asio::ip::tcp::socket socket
Definition: IoTypes.h:30
consumer< const AcceptedPacketSocketInfo & > AcceptCallback
Callback for an accepted socket.
Definition: PacketSocket.h:106
Statistics about a socket.
Definition: PacketSocket.h:41
std::function< void()> action
An action function.
Definition: functions.h:27
ExtensionManager & extensionManager()
Gets the extension manager.
Definition: ProcessBootstrapper.cpp:67
const std::shared_ptr< PacketSocket > & socket() const
Gets the socket.
Definition: PacketSocket.h:87
const PacketPayload m_payload
Definition: PacketSocket.cpp:126
virtual void close()=0
Closes the socket.
std::shared_ptr< PacketIo > CreateBufferedPacketIo(const std::shared_ptr< PacketIo > &pIo, boost::asio::io_context::strand &strand)
Adds buffering to pIo using strand for synchronization.
Definition: BufferedPacketIo.cpp:178
void Accept(boost::asio::ip::tcp::acceptor &acceptor, const PacketSocketOptions &options, const ConfigureSocketCallback &configureSocket, const AcceptCallback &accept)
Definition: PacketSocket.cpp:377
consumer< const Stats & > StatsCallback
Definition: PacketSocket.h:49
WorkingBuffer m_buffer
Definition: PacketSocket.cpp:242
std::shared_ptr< StrandedPacketSocket > m_pSocket
Definition: PacketSocket.cpp:373
virtual void stats(const StatsCallback &callback)=0
Retrieves statistics about this socket and passes them to callback.
SocketPointer pSocket
Definition: PacketWriters.cpp:46
Definition: AddressExtractionExtension.cpp:28
Process bootstrapper.
Definition: ProcessBootstrapper.h:42
Packet socket options.
Definition: PacketSocketOptions.h:27
Result of a packet socket accept operation.
Definition: PacketSocket.h:68
size_t NumUnprocessedBytes
Number of unprocessed bytes.
Definition: PacketSocket.h:46
bool IsOpen
true if the socket is open.
Definition: PacketSocket.h:43
An read-optimized interface for reading packets.
Definition: BatchPacketReader.h:27
std::function< void(TArgs...)> consumer
A consumer function.
Definition: functions.h:35
Definition: PacketSocket.h:38
ConfigureSocketCallback m_configureSocket
Definition: PacketSocket.cpp:371