|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
Owned handle for sending data through a network stream. More...
#include <NetworkSink.hpp>
Collaboration diagram for MayaFlux::Portal::Network::NetworkSink:Public Member Functions | |
| bool | is_open () const |
| Return true if the endpoint was opened successfully. | |
| const std::string & | name () const |
| Return the stream name from the config. | |
| NetworkSink (const NetworkSink &)=delete | |
| NetworkSink (const StreamConfig &config) | |
| Open a send endpoint from a StreamConfig. | |
| NetworkSink (NetworkSink &&) noexcept | |
| NetworkSink & | operator= (const NetworkSink &)=delete |
| NetworkSink & | operator= (NetworkSink &&) noexcept |
| bool | send (ByteView data) const |
| Send bytes through this sink's endpoint. | |
| bool | send_to (ByteView data, const std::string &address, uint16_t port) const |
| Send bytes to an explicit address, overriding the config target. | |
| ~NetworkSink () | |
| Close the endpoint and release resources. | |
Private Attributes | |
| uint64_t | m_endpoint_id { 0 } |
| std::string | m_name |
| Registry::Service::NetworkService * | m_service { nullptr } |
Owned handle for sending data through a network stream.
NetworkSink is the send-side counterpart to Vruta::NetworkSource. It owns one endpoint opened via NetworkService and exposes send and send_to as the only public interface.
Lifetime matches the stream: the endpoint is opened on construction and closed on destruction. Move-only.
Consumers hold a shared_ptr<NetworkSink>. A metro coroutine, a node output callback, or a future Portal::Network::PacketFlow all hold the same handle. The underlying transport is hidden behind NetworkFoundry — callers never touch NetworkService directly.
Today NetworkFoundry is a thin wrapper over NetworkService. When WebRTC or QUIC arrives, only NetworkFoundry changes.
Definition at line 43 of file NetworkSink.hpp.