COGS can send low-level network requests over the UDP protocol to other machines on the network.

⚠️ Note that the UDP protocol, while fast and efficient, does not guarantee successful delivery of UDP messages.

You will need to know the IP addresses of the machines you want to send messages to and the port number each machine is listening on.

Enable UDP in your COGS project in the “Build” view under “Show settings”.

image.png

image.png

Open the UDP panel on the left of the screen and add a “Destination”.

image.png

image.png

Set the IP address and port of your UDP server on the destination.

image.png

In a behaviour, add a “Send UDP message” action.

image.png

Select the destination you want to send the message to.

image.png

You can now enter a string that will be sent as raw UTF-8 data to the IP address and port for this destination.

image.png

You can use a Computed Value to construct a string and further customise the data that is sent.

image.png

Sending data to multiple machines or ports