Every callback on this page is a public Broadcaster member of RealtimeClient, except for the custom-event subscriptions listed under Event Subscriptions.
Subscribe with client.OnXxx.Subscribe(handler), which returns a Subscription; see Callbacks and Subscriptions for the lifetime rules and RAII helpers.
Over the C API there is nothing to subscribe to: every callback below is pre-subscribed and delivered as a numbered event on the client's event queue.
Broadcaster Events maps each callback to its event number and to the fields its parameters arrive in.
Callback
Fires When
Manual Page
OnDisconnected(DisconnectCause cause)
The connection ends, requested or not; cause carries the reason.
Custom events are not a Broadcaster member.
They are registered on RealtimeClient itself, with an event-code filter baked into the subscription; every overload returns the same Subscription type as Subscribe() does.
The payload form is deduced from the callback: std::span<const uint8_t> delivers raw bytes, const RealtimeValue& delivers the decoded payload.
The same three overloads with the payload form named explicitly, std::span<const uint8_t> or const RealtimeValue& (plain RealtimeValue is accepted as shorthand).
The callback signature of the untyped overloads is (uint8_t eventCode, int senderId, PayloadType payload).
A byte-span payload points into a decode buffer owned by the subscription and is only valid during the call.