UDP Socket

The UDPSocket object is included in the Q-SYS Designer Software's Lua extensions. The UDPSocket class can be instantiated to bind UDP functionality into control scripts and plugins. Documentation of the UDPSocket object can be found here.

This Lua script example connects the UDPSocket functionality for use in a control script or plugin.

The UDPSocket:Open() binds a local address for UDP communication into the plugin object. This optionally can be bound to a specific local IP. Or, the Q-SYS Core’s network driver can be allowed to choose. This script allows for setting the local IP address and port to bind to, selecting the name of the NIC on the Core to bind to – or, by not setting any of these, allow the Core to choose the configuration. Note that the UDP socket is opened in a protected call; if the defined socket fails to open, an error will be displayed.

The script also connects a listener to a multicast network. This code binds the listener to the QLAN UDP Discovery as set above.