SocketCluster_v2 Op

SocketCluster

connect to a socketcluster server and manage the connection


<p>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. </p> <p>There can be multiple sockets in one patch.</p> <p>Every message has a &quot;topic&quot; and a datatype, only the relevant datatypes will be received by the right receiving ops listening to that &quot;topic&quot;.</p> <p>In default mode only one &quot;client&quot; is allowed to send, this is controlled by the &quot;allowSend&quot; input. On changing this, all the other clients will be notified and change to &quot;listening&quot; state.</p> <p>By enabling &quot;allow multiple senders&quot; all the clients are allowed to send (depending on their setting of &quot;allowSend&quot;). 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!</p> <p>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.</p> <p>For more information visit: <a href="https://socketcluster.io/">https://socketcluster.io/</a></p>


Full Name
  • Ops.Extension.SocketCluster.SocketCluster_v2
Visibility
  •  Extension Op - Visible to all users
License
  • MIT
AuthorgithubMaintained by TeamJavascript Libraries


Example Patch socketcluster example

open this page in another browser or share the url of this patch!

Open In Editor

INPUT PORTS


Active (Number:

<i>boolean</i>

)

<p>toggle connected/disconnected state</p>

Server hostname (String)

<p>hostname</p>

Server path (String)

<p>path of url</p>

Server port (Number)

<p>server port</p>

Use SSL (Number:

<i>boolean</i>

)

<p>enable encryption (needs to be supported by server)</p>

Allow send (Number:

<i>boolean</i>

)

<p>allow sending from this client</p>

Allow multiple senders (Number:

<i>boolean</i>

)

<p>allow multiple senders</p>

Channel (String)

<p>name of the socketcluster channel</p>

Delay send (ms) (Number:

<i>integer</i>

)

<p>delay sending messages by x ms</p>

Additional serverdata (Object)

<p>additional data send with every message (can be used for auth-token)</p>

OUTPUT PORTS


Ready (

<i>boolean</i>

Number)

<p>connection is ready</p>

Socket (Object)

<p>socket object to connect to other socketcluster ops</p>

Own client id (String)

<p>my own client id</p>

Can send (

<i>boolean</i>

Number)

<p>wether or not this client is able/allowed to send messages</p>

Error (String)

<p>error object</p>


Patches using SocketCluster_v2

  • Examples
  • Public
  • My Patches

Changelog


created opuser avatarstephan - 2020-03-18 13:25
added lib: socketcluster-client.jsuser avatarstephan - 2020-03-18 13:26
cloned op from Ops.Net.SocketCluster.SocketClusteruser avatarstephan - 2021-05-11 13:04
Ops.User.stephan.SocketCluster_v2 renamed to Ops.Net.SocketCluster.SocketCluster_v2user avatarstephan - 2021-05-11 13:05
Ops.Net.SocketCluster.SocketCluster_v2 renamed to Ops.Extension.SocketCluster.SocketCluster_v2user avatarstephan - 2022-12-14 08:35
improvementprint error message, remove connection on op delete, return error stringuser avatarstephan - 2024-10-02 16:52