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

◆ send_to()

bool MayaFlux::Portal::Network::NetworkSink::send_to ( ByteView  data,
const std::string &  address,
uint16_t  port 
) const

Send bytes to an explicit address, overriding the config target.

Parameters
dataRead-only byte view of the payload.
addressTarget IP address string.
portTarget port.
Returns
true if the send was accepted.

Primary use: UDP fan-out to a different peer than the default target. TCP ignores address/port and uses the connected peer.

Definition at line 108 of file NetworkSink.cpp.

109{
110 if (m_endpoint_id == 0 || !m_service) {
111 return false;
112 }
113 return m_service->send_to(m_endpoint_id, data.data(), data.size(), address, port);
114}
Registry::Service::NetworkService * m_service
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.

References m_endpoint_id, m_service, and MayaFlux::Registry::Service::NetworkService::send_to.