42 "NetworkSink '{}': NetworkService not available",
m_name);
60 "NetworkSink '{}': endpoint open failed",
m_name);
77 : m_name(std::move(other.m_name))
78 , m_endpoint_id(other.m_endpoint_id)
79 , m_service(other.m_service)
81 other.m_endpoint_id = 0;
82 other.m_service =
nullptr;
88 if (m_endpoint_id != 0 && m_service) {
89 m_service->close_endpoint(m_endpoint_id);
91 m_name = std::move(other.m_name);
92 m_endpoint_id = other.m_endpoint_id;
93 m_service = other.m_service;
94 other.m_endpoint_id = 0;
95 other.m_service =
nullptr;
#define MF_WARN(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
Registry::Service::NetworkService * m_service
NetworkSink(const StreamConfig &config)
Open a send endpoint from a StreamConfig.
bool send(ByteView data) const
Send bytes through this sink's endpoint.
~NetworkSink()
Close the endpoint and release resources.
NetworkSink & operator=(const NetworkSink &)=delete
bool send_to(ByteView data, const std::string &address, uint16_t port) const
Send bytes to an explicit address, overriding the config target.
Owned handle for sending data through a network stream.
Interface * get_service()
Query for a backend service.
static BackendRegistry & instance()
Get the global registry instance.
NetworkTransport
Identifies the transport protocol a backend implements.
@ Networking
Network operations (data transfer, protocol handling)
@ Portal
High-level user-facing API layer.
NetworkTransportHint
Portal-level transport hint, independent of Core::NetworkTransport.
@ SHARED_MEMORY
Zero-copy IPC on the same machine.
@ TCP
Reliable ordered byte stream. Bulk data, session-oriented.
@ AUTO
Let NetworkFoundry pick based on StreamProfile.
@ UDP
Low-latency, unordered datagrams. OSC, control, sparse streams.
std::span< const uint8_t > ByteView
Convenience alias for a read-only byte view.
StreamProfile
Data characteristics that drive transport and framing selection.
@ ORDERED_BULK
Large payloads, loss-intolerant, ordering required.
NetworkTransport transport
std::string remote_address
Describes one logical send/receive endpoint managed by a backend.
NetworkTransportHint transport
Full configuration for an outbound or bidirectional stream.
uint16_t port
Remote port (send) or local port (receive).
uint16_t local_port
Explicit local bind port. 0 = OS-assigned.
std::string address
Remote address. Empty = listen only.
std::function< bool(uint64_t endpoint_id, const uint8_t *data, size_t size)> send
Send data through an endpoint.
std::function< bool(uint64_t endpoint_id, const uint8_t *data, size_t size, const std::string &address, uint16_t port)> send_to
Send data to a specific address through an endpoint.
std::function< void(uint64_t endpoint_id)> close_endpoint
Close an endpoint.
Backend network transport service interface.