UCE Docs / ws_connection_id

Signature

String ws_connection_id()

Parameters

return value : connection ID of the current WebSocket client

Returns the runtime-generated connection ID of the client whose message is currently being handled.

This ID can be passed to ws_send_to() or ws_close() to target a single connected client.

Example

String id = ws_connection_id();
print(id == "" ? "(empty outside a WS handler)" : id, "\n");
Output
(empty outside a WS handler)