SocketCluster_v2 Op
connect to a socketcluster server and manage the connection
Summary (oneliner)
SocketCluster connects to the websocket at the given hostname. Then you define a channel that all the messages will be sent to. SocketCluster outputs a socket that has to be used in senders and receivers.
There can be multiple sockets in one patch.
Every message has a "topic" and a datatype, only the relevant datatypes will be received by the right receiving ops listening to that "topic".
In default mode only one "client" is allowed to send, this is controlled by the "allowSend" input. On changing this, all the other clients will be notified and change to "listening" state.
By enabling "allow multiple senders" all the clients are allowed to send (depending on their setting of "allowSend"). This can lead to endless loops in for example a setup where a TriggerChangeValue triggers a send, then the message is received and changes the value...be careful!
Clients do not handle their own messages, every statechange has to be done directly in the patch as well. This is to avoid more possibilities for endless loops.
For more information visit: https://socketcluster.io/
- Ops.Extension.SocketCluster.SocketCluster_v2
- Extension Op - Visible to all users
- MIT
- socketcluster client (socketcluster client)
Documentation (markdown)
Issues
Example patch id
Youtube ids (comma seperated)
Op Licence
Caniuse query
Example Patch socketcluster example
INPUT PORTS
toggle connected/disconnected state
hostname
path of url
server port
enable encryption (needs to be supported by server)
allow sending from this client
allow multiple senders
name of the socketcluster channel
delay sending messages by x ms
additional data send with every message (can be used for auth-token)
OUTPUT PORTS
connection is ready
socket object to connect to other socketcluster ops
my own client id
wether or not this client is able/allowed to send messages
error object
Patches using SocketCluster_v2
Changelog
created op | stephan - 2020-03-18 13:25 | |
added lib: socketcluster-client.js | stephan - 2020-03-18 13:26 | |
cloned op from Ops.Net.SocketCluster.SocketCluster | stephan - 2021-05-11 13:04 | |
Ops.User.stephan.SocketCluster_v2 renamed to Ops.Net.SocketCluster.SocketCluster_v2 | stephan - 2021-05-11 13:05 | |
Ops.Net.SocketCluster.SocketCluster_v2 renamed to Ops.Extension.SocketCluster.SocketCluster_v2 | stephan - 2022-12-14 08:35 |