Lightact allows you to send and receive TCP, UDP or OSC messages. The key differences between them are:
- UDP: an internet messaging protocol (User Datagram Protocol), that is very common in entertainment. It’s very fast but you don’t get a confirmation of a successful transmission. Art-Net is based on that though.
- TCP: standard internet protocol (Transmission Control Protocol). It requires both the sender and recipient to confirm successful transmission. It is, therefore, a bit slower than UDP, but more reliable.
- OSC: Open Sound Protocol is built on UDP, but includes some features that make it more useful for entertainment. Lightact allows you to send floats, integers and strings.
Receiving TCP (or UDP)
This article walks you through setting up TCP receiving and sending. To set up UDP sending and receiving just change ‘TCP’ to ‘UDP’ in the text below as the process is the same
To receive a TCP message open Devices window by going to Window and clicking on Devices (or press F7). When it’s opened, insert a TCP Reader node by right-clicking on the left side, hovering above TCP and clicking on Reader.
After that, a popup window will open where you have to insert the port number on which you’ll be listening for TCP messages.
If you don’t know it yet, don’t worry – you can always change it later. Click OK.
When the node is created you can select it and you’ll see its properties on the right.
Here you can change the name of the node, you can see the current IP address of your computer and you can also change the port this TCP server node is listening to.
Before this node will actually start listening you have to check the Listening checkbox.
That’s all we had to do in Devices window. Now we just have to create a TCP Listener node in a layer layout and select our TCP Reader 1 node as its parent. So, let’s get to it.
Setup in Layer Layouts
Open a layout of an existing layer or create a new one. Once its opened right click somewhere on the left side and enter TCP Listener in the search box.
Click on TCP Listener to insert the node.
Then, select it and in the properties on the right select the TCP Server node you created before in the Devices window.
This should be it. You can now connect the string output of TCP Listener node to any other node with a string output.
The New message lifeline output executes whenever there is a new message coming on the selected TCP reader node.
Receiving UDP is very similar, except that in the Devices window you insert a UDP Server and in a Layer Layout you insert a UDP Listener node.
Please note, you can map several Listener nodes in a Layout to one Reader node in the Devices window.
Sending TCP (or UDP)
Sending a TCP message is similar to receiving it, except that in the Devices window you insert a TCP Writer node
and make sure the IP address and port number are what you want them to be. Make sure to check the Streaming checkbox after. If the writer connected, you’ll see a green Connected label.
Then you open a Layer Layout and instead of a TCP Listener node, you insert a TCP Sender node.
Make sure to set up a correct Parent device and to connect its Lifeline input.
Sending UDP is very similar, except that in the Devices window you insert a UDP Client and in a Layer Layout you insert a UDP Sender node.