TsgcWSPServer_WebRTC › Methods › Broadcast
Sends a text payload to every peer subscribed to the signalling channel, optionally excluding or targeting specific connections.
procedure Broadcast(aMessage: string; aChannel: string = ''; Exclude: String = ''; Include: String = '');
| Name | Type | Description |
|---|---|---|
aMessage | string | Text payload delivered to the subscribers; usually a chat line, a room notice or application-specific metadata that sits alongside the SDP/ICE relay. |
aChannel | string | Channel (room) the broadcast is scoped to. When empty, the frame is sent to every connected peer regardless of their subscriptions. |
Exclude | String | GUID of a connection that must be skipped — typically the sender, so it does not echo its own message back. |
Include | String | GUID of a single target connection: when set, only that peer receives the frame, overriding the channel fan-out. |
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.
// push a room notice to every peer in channel "room-42"
WebRTCSrv.Broadcast('{"type":"notice","text":"recording started"}',
'room-42');