Skip to main content

UDP Transport

Sends and receives UDP datagrams on a local port. Each datagram is one message, so no codec is needed. Received messages carry the sender in their metadata (udp_source_address, udp_source_port), which Lua can use to reply.

UDP has no connection, so every outgoing message needs a destination: use the UDP message input (destination address and port per input) or udp_send in Lua.

Turn on Enable Broadcast to send to a broadcast address such as 255.255.255.255. For multicast, list the groups to join; Multicast TTL limits how many routers a datagram crosses, and Multicast Loopback also delivers your own multicast datagrams back to this computer.

Configuration reference​

Config IDudp_transport
Selected byapp_transport = "udp_transport"
PlatformsLinux, Windows, Android
LicenseFree

UDP datagram communication

Basic Configuration:

  • Bind Address: Local address to listen on (0.0.0.0 for all interfaces, 127.0.0.1 for localhost only)
  • Bind Port: Local port number to listen on
  • Enable Broadcast: Allow sending and receiving broadcast packets

Multicast Configuration:

  • Multicast Groups: Supports both IPv4 (e.g., 239.255.0.1) and IPv6 (e.g., ff02::1), one address per line
  • IPv4 TTL: Time-To-Live for multicast packets (1-255), higher values allow wider propagation
  • IPv6 Hop Limit: IPv6 multicast hop limit (1-255, currently uses system default)
  • Multicast Loopback: When enabled, multicast packets sent by this host will also be received by this host
SettingKeyTypeDefaultNotes
Bind Addressudp_transport_bind_addressText (with presets)"0.0.0.0"Required
Bind Portudp_transport_bind_portInteger5000Required
Enable Broadcastudp_transport_enable_broadcastBooleanfalse
Enable Multicastudp_transport_enable_multicastBooleanfalse
Multicast Groupsudp_transport_multicast_groupsTextsee belowShown when Enable Multicast (udp_transport_enable_multicast) = true
Multicast TTLudp_transport_multicast_ttlInteger1Shown when Enable Multicast (udp_transport_enable_multicast) = true
IPv6 Hop Limitudp_transport_multicast_hop_limitInteger1Shown when Enable Multicast (udp_transport_enable_multicast) = true
Multicast Loopbackudp_transport_multicast_loopbackBooleantrueShown when Enable Multicast (udp_transport_enable_multicast) = true

Setting details​

Bind Address​

Presets (any other value can be entered):

ValueLabel
"0.0.0.0"0.0.0.0 (Any)
"127.0.0.1"127.0.0.1 (Localhost)

Multicast Groups​

Default:

239.255.0.1
ff02::1

Example config​

Default values as they appear in a saved configuration (for example the JSON block at the end of a cycbox/examples/*.lua file). Settings detected at runtime are omitted.

{
"app": {
"app_transport": "udp_transport"
},
"udp_transport": {
"udp_transport_bind_address": "0.0.0.0",
"udp_transport_bind_port": 5000,
"udp_transport_enable_broadcast": false,
"udp_transport_enable_multicast": false,
"udp_transport_multicast_groups": "239.255.0.1\nff02::1",
"udp_transport_multicast_ttl": 1,
"udp_transport_multicast_hop_limit": 1,
"udp_transport_multicast_loopback": true
}
}