UDP
A connectionless UDP socket. Used by protocols that broadcast, that talk to devices which never open a connection of their own, or that were simply specified on top of UDP.
Transport syntax
{IP address or hostname}[:{port}]
The port may be omitted if the driver declares a default port for the protocol.
knxnet-ip://192.168.1.10
modbus-tcp:udp://192.168.1.100:502
Name |
Type |
Default Value |
Required |
Description |
Name |
UDP |
|||
Code |
|
|||
Maven Dependency |
<dependency> <groupId>org.apache.plc4x</groupId> <artifactId>plc4j-transports-udp</artifactId> <version>1.0.0</version> </dependency> |
|||
Config options: |
||||
|
STRING |
Local address to bind to. If not set, binds to all interfaces. |
||
|
INT |
0 |
Local port to bind to. 0 uses ephemeral port. |
|
|
INT |
0 |
Socket read timeout in milliseconds. 0 means no timeout. |
|
|
INT |
65507 |
Maximum UDP packet size in bytes. |
|
|
INT |
0 |
Send buffer size in bytes. 0 uses system default. |
|
|
INT |
0 |
Receive buffer size in bytes. 0 uses system default. |
|
|
BOOLEAN |
false |
Enable SO_BROADCAST for sending broadcast packets. |
|
|
BOOLEAN |
false |
Enable SO_REUSEADDR to allow multiple bindings to the same address/port. |
|
|
BOOLEAN |
false |
Share the underlying UDP socket across multiple transport instances. When true, instances with the same localAddress:localPort will share a socket. This is useful for protocols where multiple logical connections share one UDP port. |
|
|
INT |
1 |
Time-to-live for multicast packets (1-255). |
|
Set udp.broadcast=true to send to a broadcast address, and udp.share-socket=true when several
connections have to share one local port - which is what protocols that answer on a fixed port
require.