44 static std::unique_ptr<OscChannel>
open(
45 std::string_view
host, std::uint16_t remote_port,
52 bool send(
const std::uint8_t* data, std::size_t size)
override;
57 bool is_open()
const override {
return open_.load(); }
64 return receiver_.local_address();
67 return receiver_.local_port();
73 void dispatch_message(
const Message& msg);
74 void dispatch(std::function<
void()> fn);
79 std::atomic<bool> open_{
false};
80 std::atomic<bool> closed_fired_{
false};
Definition osc_channel.hpp:39
void on_error(pulp::runtime::ChannelErrorCallback callback) override
bool is_open() const override
Whether the channel is currently usable.
Definition osc_channel.hpp:57
void on_closed(pulp::runtime::ChannelClosedCallback callback) override
void close() override
Close the channel. Idempotent. Fires the closed callback.
std::uint16_t local_port() const
Definition osc_channel.hpp:66
bool send(const std::uint8_t *data, std::size_t size) override
Send a message.
void on_message(pulp::runtime::MessageCallback callback) override
Install / replace callbacks.
static std::unique_ptr< OscChannel > open(std::string_view host, std::uint16_t remote_port, std::uint16_t local_port, OscChannelOptions options={})
Construct a bidirectional channel: sender targets (host, remote_port) and the receiver listens on loc...
bool send(const Message &msg)
Convenience — encode and send a structured OSC message.
std::string local_address() const
Address and port the receiving side is bound to; empty / 0 when closed.
Definition osc_channel.hpp:63
Abstract base for message-oriented channels.
Definition message_channel.hpp:70
Bounded event contracts shared by host ingress and graph-authored nodes.
Definition anticipation_eligibility.hpp:9
constexpr std::string_view kBindLoopback
Definition osc.hpp:118
std::function< void()> ChannelClosedCallback
Called once when the channel transitions to a closed state — either the peer closed,...
Definition message_channel.hpp:55
std::function< void(const Message &message)> MessageCallback
Called when the channel receives a complete message.
Definition message_channel.hpp:51
std::function< void(std::string_view reason)> ChannelErrorCallback
Called when a transport-level error occurs.
Definition message_channel.hpp:60
std::function< void(std::function< void()>)> MessageExecutor
Executor used to dispatch callbacks off whichever worker thread the channel runs internally.
Definition message_channel.hpp:64
Definition osc_channel.hpp:30
pulp::runtime::MessageExecutor executor
Dispatch executor (same semantics as other channels).
Definition osc_channel.hpp:33
std::string bind_address
IPv4 literal the receiving side binds.
Definition osc_channel.hpp:36