MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ to_stream_config()

StreamConfig MayaFlux::Portal::Network::to_stream_config ( const Core::EndpointInfo & info)
inlinenodiscard

The StreamConfig that opens a sink to the remote side of an endpoint.

Takes what a sink needs from a Core::EndpointInfo: the transport, the remote address and port or the remote socket path, the local port, the framing and the message size limit. The label becomes the stream name.

Parameters
infoEndpoint as chosen or written by hand.

Definition at line 144 of file NetworkUtils.hpp.

145{
146 StreamConfig config;
147 config.name = info.label;
148 config.framing = info.framing;
150
151 switch (info.transport) {
154 break;
157 break;
160 break;
163 break;
166 break;
167 }
168
169 config.serial = info.serial;
170
172 config.endpoint.path = info.remote_path;
173 } else {
174 config.endpoint.address = info.remote_address;
175 config.endpoint.port = info.remote_port;
176 config.endpoint.local_port = info.local_port;
177 }
178
179 return config;
180}
@ SHARED_MEMORY
Zero-copy IPC on the same machine.
@ SERIAL
A serial port, as a byte stream.
@ TCP
Reliable ordered byte stream. Bulk data, session-oriented.
@ UDS
Reliable ordered messages to a Unix domain socket on the same machine.
@ UDP
Low-latency, unordered datagrams. OSC, control, sparse streams.
SerialLineSettings serial
Serial: the line setup applied at open. The device path is remote_path.
FramingPolicy framing
TCP and UDS: how messages are delimited.
std::string remote_path
UDS: socket to connect to, given the same way as local_path.
size_t max_message_size
TCP and UDS: the largest message in bytes, 0 for the framing's own limit.
size_t max_message_size
TCP and UDS: largest message or line in bytes. 0 = the framing's own limit.
SerialLineSettings serial
Serial: the line setup applied at open.
Full configuration for an outbound or bidirectional stream.
std::string path
UDS: socket to connect to, a bare name being looked up in the runtime directory. Serial: the device p...
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.

References MayaFlux::Portal::Network::StreamEndpoint::address, MayaFlux::Portal::Network::StreamConfig::endpoint, MayaFlux::Core::EndpointInfo::framing, MayaFlux::Portal::Network::StreamConfig::framing, MayaFlux::Core::EndpointInfo::label, MayaFlux::Core::EndpointInfo::local_port, MayaFlux::Portal::Network::StreamEndpoint::local_port, MayaFlux::Core::EndpointInfo::max_message_size, MayaFlux::Portal::Network::StreamConfig::max_message_size, MayaFlux::Portal::Network::StreamConfig::name, MayaFlux::Portal::Network::StreamEndpoint::path, MayaFlux::Portal::Network::StreamEndpoint::port, MayaFlux::Core::EndpointInfo::remote_address, MayaFlux::Core::EndpointInfo::remote_path, MayaFlux::Core::EndpointInfo::remote_port, MayaFlux::Core::SERIAL, SERIAL, MayaFlux::Core::EndpointInfo::serial, MayaFlux::Portal::Network::StreamConfig::serial, MayaFlux::Core::SHARED_MEMORY, SHARED_MEMORY, MayaFlux::Core::TCP, TCP, MayaFlux::Core::EndpointInfo::transport, MayaFlux::Portal::Network::StreamConfig::transport, MayaFlux::Core::UDP, UDP, MayaFlux::Core::UDS, and UDS.