Capy-Bearer Documentation

ws_send

lib call

Capy

function ws_send(message : string, binary : bool, request : capture any) bool
function ws_send(message : string, binary : bool, scope : string, request : capture any) bool

Description

ws_send() broadcasts to every client in the current scope, including the sender. Pass scope to select another scope. Use ws_send_to() for a reply to one connection.

Pass false as the second argument for a text frame, or true for a binary frame. The broker processes queued commands after dispatch. A successful result is not a delivery acknowledgment.

Parameters

request : the caller's request, captured when omitted

message : message bytes to send

binary : true for a binary frame

scope : scope identifier

Return Values

true when the request workspace records a broadcast command. This does not confirm that any client exists or received the message.

Example

Capy

ws_send("hello", false)

Output

hello