UDP Send (udp-out)¶
Sends msg.payload as a UDP datagram. Three modes share the same
write path; the differences are setsockopt-level — SO_BROADCAST
for broadcast and TTL / loopback / outbound interface for multicast.
| Inputs | Outputs |
|---|---|
| 1 | 0 |
Modes¶
| Mode | Behaviour |
|---|---|
unicast |
Send to a single host:port. |
broadcast |
Set SO_BROADCAST on the socket; send to a broadcast address (255.255.255.255 or directed). |
multicast |
IPv4 multicast send with configurable TTL, loopback, and outbound interface. |
Configuration¶
| Field | Default | Description |
|---|---|---|
mode |
unicast |
unicast, broadcast, or multicast. |
host |
— | Destination host. msg.host overrides. |
port |
— | Destination port. msg.port overrides. |
bindHost |
— | Multicast only: name of the outbound interface (e.g. eth0). |
multicastTTL |
1 |
Multicast only. 1 = LAN-local. Range 0–255. |
multicastLoopback |
true |
Multicast only. Loopback to the sending host. |
reuseSocket |
true |
Keep one outbound socket across messages. |
Incoming message¶
| Field | Description |
|---|---|
payload |
Body to send. string, []byte, []int (number array), or any other type (fmt.Sprint-rendered). Empty is allowed (zero-length datagram is legal in UDP). |
host |
Per-message destination override. |
port |
Per-message destination override. |
Status¶
- Green
sent · 137B → host:portafter each successful send. - Yellow
send: …on transient errors (DNS, kernel buffer full). - Red on configuration errors.
Notes¶
- Broadcast: the node sets
SO_BROADCASTon the socket so the kernel allows writes to broadcast addresses. The default unicast socket would silently fail. - Multicast TTL:
1keeps the packet on the local link. Bump it to traverse routed subnets — but coordinate with your network team because most routers drop multicast. reuseSocket=falseopens a fresh socket for every send. Rare; useful only when source-port randomisation is required per packet.
Examples¶
Send a syslog event.
Multicast discovery beacon.
Broadcast a heartbeat to the local subnet.