TsgcWSPServer_WebRTCMethods › Broadcast

Broadcast Method

Sends a text payload to every peer subscribed to the signalling channel, optionally excluding or targeting specific connections.

Syntax

procedure Broadcast(aMessage: string; aChannel: string = ''; Exclude: String = ''; Include: String = '');

Parameters

NameTypeDescription
aMessagestringText payload delivered to the subscribers; usually a chat line, a room notice or application-specific metadata that sits alongside the SDP/ICE relay.
aChannelstringChannel (room) the broadcast is scoped to. When empty, the frame is sent to every connected peer regardless of their subscriptions.
ExcludeStringGUID of a connection that must be skipped — typically the sender, so it does not echo its own message back.
IncludeStringGUID of a single target connection: when set, only that peer receives the frame, overriding the channel fan-out.

Remarks

Wraps the text in the signalling envelope as a sgc@broadcast method on the requested channel and dispatches it through the base subscription server. Unlike the peer-to-peer sgc@webrtc relay that carries SDP offers/answers and ICE candidates, Broadcast is an application-level chat/control channel shared by every subscriber of a room. Call it from the server whenever you need to push a snapshot, moderation event or out-of-band notice to all peers that joined a specific signalling room.

Example


// push a room notice to every peer in channel "room-42"
WebRTCSrv.Broadcast('{"type":"notice","text":"recording started"}',
  'room-42');

Back to Methods