![]() |
dfx 0.1.0
Linux-based dynamic dataflow executor
|
TCP session that ignores inbound traffic and is used only for streaming capture data out. More...
#include <dfx-pcapng/sinks/TcpSink.hpp>
Public Member Functions | |
| TcpSession (std::string host, std::string serv, TcpServer &server, std::chrono::milliseconds initialTimeout) | |
| Construct a session descriptor (not yet bound to a socket). | |
| Public Member Functions inherited from dfx::Server::TcpSession | |
| TcpSession (std::string host, std::string serv, TcpServer &server, std::chrono::milliseconds initialTimeout) | |
| Construct a session descriptor (not yet bound to a socket). | |
| DISABLE_COPY_AND_MOVE (TcpSession) | |
| TcpSession are not copyable and not movable. | |
| virtual | ~TcpSession ()=default |
| Virtual destructor for polymorphic session types. | |
| FdWatch::BorrowedFd | socket () const noexcept |
| Borrowed socket FD (valid after init()). | |
| std::string const & | host () const noexcept |
| Remote host string. | |
| std::string const & | serv () const noexcept |
| Remote service/port string. | |
| void | init (FdWatch::OwnedFd socket, FdWatch::Poller &poller) |
| Bind the accepted socket to this session and register it to the poller. | |
| bool | subtractTimeAndCheckTimeout (std::chrono::milliseconds time) |
| Decrease the remaining time before timeout and report expiration. | |
| std::chrono::milliseconds | initialTimeout () const noexcept |
| Current configured initial timeout value. | |
| void | setInitialTimeout (std::chrono::milliseconds timeout) |
| Update the initial timeout value. | |
| void | sendMessage (std::vector< uint8_t > const &message) |
| Queue an outgoing message to be sent asynchronously. | |
Protected Member Functions | |
| void | handleMessage (std::vector< uint8_t >) override |
| Ignore any inbound messages (capture is output-only). | |
| Protected Member Functions inherited from dfx::Server::TcpSession | |
| void | resetTimeout () |
| Reset the remaining timeout countdown to the configured initial value. | |
| void | terminate () |
| Ask the owning server to terminate this session. | |
| void | setMaxDataQueueSize (std::size_t size) |
| Set the maximum number of queued outgoing messages. | |
| std::size_t | maxDataQueueSize () const noexcept |
| Maximum number of queued outgoing messages. | |
Additional Inherited Members | |
| Public Types inherited from dfx::Server::TcpSession | |
| enum class | TimeoutPolicy { Disabled , Manual , ResetOnRead , ResetOnWrite , ResetOnAny } |
| Policy describing when I/O activity resets the inactivity timeout. More... | |
| Protected Attributes inherited from dfx::Server::TcpSession | |
| std::string | _host |
| Remote host string. | |
| std::string | _serv |
| Remote service/port string. | |
| TimeoutPolicy | _timeoutPolicy = TimeoutPolicy::ResetOnAny |
| Timeout reset policy. | |
TCP session that ignores inbound traffic and is used only for streaming capture data out.
This session type is used by TcpSink to represent a connected client. Incoming messages are intentionally ignored: the session exists solely as a write-only transport for PCAPNG bytes.
|
inlineoverrideprotectedvirtual |
Ignore any inbound messages (capture is output-only).
Implements dfx::Server::TcpSession.
| dfx::Server::TcpSession::TcpSession | ( | std::string | host, |
| std::string | serv, | ||
| TcpServer & | server, | ||
| std::chrono::milliseconds | initialTimeout ) |
Construct a session descriptor (not yet bound to a socket).
The accepted socket is provided later through init().
| host | Remote host string (typically from getnameinfo / accept). |
| serv | Remote service/port string. |
| server | Reference to the owning server. |
| initialTimeout | Initial inactivity timeout for the new session. |