Close

Palette:signalingClient

Summary

The signalingClient COMP is a component that can be used to connect to a signalingServer COMP within TouchDesigner as well as exchange messages with other signalingClients through the signaling server it is connected with.

When a client is sending a signaling message to the server, a target should be specified as part of the Signaling API. More details about the Signaling API are available at Palette:signalingServer#SignalingAPI

The server is using the target property to route the message to a matching, connected, client.

The receiving client is then parsing the message and routing the message to a matching method using the signalingType property.

i.e. A signalingClient COMP is receiving a message where message['signalingType'] is equal to ClientEntered, the onMessageReceivedClientEntered() method will be called.

If no matching method is found, the signalingClient will fail gracefully.

While we advise to make use of Subscribers and the Subscribe() method to extend the signalingClient, users that want to extend the Signaling API with custom types should add new methods prefixed by onMessageReceived.

i.e If a user wants to add a custom type Animal, a matching method onMessageReceivedAnimal() should be available in the Palette:signalingClient Ext.

More details about Subscribers and the Subscribe() method are available on this page.

The communication protocol used as part of this signalingClient is WebSocket.

It is often used as part of WebRTC sessions.

Known issues / missing features in experimental:

  • When the signalingServer is being restarted, or a signaling session is dropping for some reason, it can happen that the states are not reset properly.
  • Support for signaling servers other than TouchDesigner's Signaling API will come in future releases.

PythonIcon.pngPalette:signalingClient Ext


Parameters - Signaling Client Page

Active Active - Start or stop the signaling client.

Reset Reset - Restart the signaling client and reset all states.

Host Host - The signaling server IP or URL to connect to. If the server is secured, it should use a secure protocol such as wss://.

Port Port - Port on which this client will connect to the signaling server.

Forward To Subscribers Forwardtosubscribers - When enabled, any message received with a type that matches a type registered by a subscriber using the Subscribe() method will be forwarded to the registered subscriber.

Client Name Clientname - An optional parameter to be used to identify the client. Default is set when the client connected to a signaling server and a UUID was sent back.

Use JSON Schema In Usejsonschemain - Validate incoming Signaling API messages against JSON Schema.

Use JSON Schema Out Usejsonschemaout - Validate outgoing Signaling API messages against JSON Schema.

Use local RefResolver Uselocalrefresolver - Use JSON Schema files installed locally rather than validating from remote sources. Schema files available at https://github.com/TouchDesigner/SignalingAPI

Local Schema Folder Localschemafolder - A folder where the JSON Schema files for the Signaling API are available locally.

Clear schema cache Clearschemacache - Signaling API schema files are loaded once. Clearing the cache force them to reload on the next call that requires JSON Schema.

Signaling API Version Signalingapiversion - The Signaling API version. When a signaling client is being used, the API version of both the server and client should match.

Signaling API Schema Endpoint Signalingapischemaendpoint - The endpoint being used to fetch the JSON Schema files.


Parameters - Logger Page

Enable Logging Enablelogging - Enable advanced logging features. Useful to debug and track the signaling client activity.

Log to File Logtofile - When enabled, logging messages will be written to a time rotating log file.

Log Folder Logfolder - Path to the folder in which the log files will be written.

File Rotation Filerotation - Number of backup files to be kept when rotating log.

Log to Textport Logtotextport - When enabled, log messages will be displayed in the textport.

Log to Status Bar Logtostatusbar - When enabled, log messages will be displayed in the status bar.

Log Level Loglevel - - Filter level of log messages. The selected level is included as well as all levels above. i.e. if Warning is selected, Warning and Error messages will be included while Info messages will be excluded.

  • INFO INFO -
  • DEBUG DEBUG -
  • WARNING WARNING -
  • ERROR ERROR -
  • CRITICAL CRITICAL -


Parameters - About Page

Help Help - Open Help page in external browser.

Version Version - The component version number.

TouchDesigner Build: