Skip to content

Control Message Structure

Julian Knight edited this page Oct 30, 2017 · 23 revisions

This page is to be used for design notes around the control channel.

The control channel is a separate Socket.IO channel to the data channels (The server channel sends from the server to the client, the client channel goes from the client to the server). Each instance of a uibuilder node gets it own Socket.IO session and you can limit messages to specific clients by using the _clientId (delete it if you want to send a message from a specific client to all clients connected to a node instance).

The control channel is there to keep control information separate to the general data.

The general structure of a control message is:

{ "type": "<text>" }

But other properties can be added as required.

Initially, only 2 control messages have been used.

  • type = server connected (server -> client): Sent when Socket.IO connects to client. This message includes an extra property "debug": <boolean>
  • type = shutdown (server -> client): Sent when the node instance is either redeployed or removed from Node-RED.

Questions

Please add any questions you want answering here - please start them with your initials

  • JK: Should the server have a 2nd output port for passing on control messages? OR should they be passed out of the standard port. If using the standard port, should there be an option to turn them on/off?
  • JK: Should the server send out control messages from itself to the chosen output port? Generally, I'm assuming that control msgs go from client to server or server to client. Do we, for example, want a control message when the server loses touch with a client?

Ideas

Please add any ideas you have here for further discussion and design. Please start with your initials.

  • ?
Clone this wiki locally