Capy-Bearer Documentation

ws_close

lib call

Capy

function ws_close(connection_id : string = "", request : capture any) bool

Description

ws_close() requests closure of the current WebSocket client. Pass a client ID to select another client. The broker processes the command after dispatch. The call does not return from the handler, so use return if no further work is needed.

Parameters

request : the caller's request, captured when omitted

connection_id : client ID. The default is the current client.

Return Values

true when the request workspace records a close command. This does not confirm that the target client exists or has closed.

Example

Capy

ws_close()

Output

WebSocket closed with code 1000