Appearance
UDP client
Sends the bytes of every input record as one UDP datagram to a configured address and port, and optionally emits the datagrams the remote side sends back. Use it for UDP-based devices, telemetry or simple request/reply protocols.
Pins
| Pin | Kind | Types | Description |
|---|---|---|---|
| Input | input | Viaducta.Plugins.UdpTypes.UdpDatagram, Viaducta.Plugins.TextPlugin.Types.TextRecord | Data to send. |
| Output | output | Viaducta.Plugins.UdpTypes.UdpDatagram | Datagrams received from the remote endpoint, with new metadata. |
| Continue | continue | same as input | Called after sending, with the original input and metadata. |
Configuration
| Field | Type | Default | Description |
|---|---|---|---|
Address | string | 127.0.0.1 | Required. Target host name or IP. |
Port | integer (1-65535) | 7000 | Required. Target port. |
ReceiveBufferSize | integer (KB, 8-2048) | 64 | Socket receive buffer. Too small buffers can drop incoming datagrams. |
SendBufferSize | integer (KB, 8-2048) | 32 | Socket send buffer. |
Behaviour
- On the first record a UDP socket is created and bound ("connected") to
Address:Port; it is reused for later records. - What is sent (one datagram per record):
UdpDatagram: theDatabytes.TextRecord:Valueencoded as UTF-8.- Empty data or another type throws an exception.
- If
Outputhas connections when the socket is created, a background reader emits every datagram received fromAddress:Portas aUdpDatagram(IP,Portof the sender,Data) with new metadata. Replies are not correlated with requests. Continueis called after each send.
Notes
- The target is always
Address:Portfrom the configuration.UdpDatagram.IP/Portare not used as the destination; worse, a datagram whoseIPdiffers fromAddressmakes the component create a new socket (and reader) for every record without closing the old one. LeaveIPempty (or equal toAddress) on input datagrams. - UDP gives no delivery guarantee:
Continueonly means the datagram was handed to the network stack. - Datagrams larger than the network MTU are fragmented by IP and may be lost on some networks; keep payloads small.
Example
json
{ "Address": "192.168.1.50", "Port": 9000, "ReceiveBufferSize": 64, "SendBufferSize": 32 }Data mapper (build TextRecord) → UDP client → Output → (decode reply) → ...