UCE Docs / ws_connection_count

Signature

u64 ws_connection_count(String scope = "")

Parameters

scope : optional scope identifier, defaults to the current WebSocket page scope
return value : number of connected WebSocket clients in that scope

Returns the number of currently connected WebSocket clients for the given scope.

If scope is omitted, the current page scope is used.

Example

print("connection count in this scope: ", ws_connection_count(), "\n");
Output
connection count in this scope: 0