16#include <dfx-server/TcpServerForSession.hpp>
73 TcpSink(std::string host =
"localhost", uint16_t port = 19'000);
83 void init(std::vector<uint8_t> initialHeader)
override;
92 void write(std::vector<uint8_t> data)
override;
Sink() noexcept=default
Construct a sink.
TcpSink(std::string host="localhost", uint16_t port=19 '000)
Construct a TCP sink listening on host:port.
void init(std::vector< uint8_t > initialHeader) override
Initialize the sink and start the TCP server.
Server::TcpServerForSession< WriteOnlySession > Server
Server type used by this sink (write-only sessions).
Definition TcpSink.hpp:62
std::unique_ptr< Server > ServerPtr
Owning pointer to the server instance.
Definition TcpSink.hpp:64
void write(std::vector< uint8_t > data) override
Broadcast serialized PCAPNG bytes to all connected clients.
TCP session that ignores inbound traffic and is used only for streaming capture data out.
Definition TcpSink.hpp:28
void handleMessage(std::vector< uint8_t >) override
Ignore any inbound messages (capture is output-only).
Definition TcpSink.hpp:34
Convenience TcpServer that instantiates a fixed TcpSession type.
Definition TcpServerForSession.hpp:50
One asynchronous TCP connection managed by TcpServer.
Definition TcpSession.hpp:81
TcpSession(std::string host, std::string serv, TcpServer &server, std::chrono::milliseconds initialTimeout)
Construct a session descriptor (not yet bound to a socket).
Definition Capture.hpp:27
TCP server configuration.
Definition TcpServer.hpp:74