TCP
The default transport for most Ethernet-based protocols: a plain TCP client socket.
Transport syntax
{IP address or hostname}[:{port}]
The port may be omitted if the driver declares a default port for the protocol.
modbus-tcp://192.168.1.100
modbus-tcp:tcp://plc-hall-2.example.com:502
Name |
Type |
Default Value |
Required |
Description |
Name |
TCP |
|||
Code |
|
|||
Maven Dependency |
<dependency> <groupId>org.apache.plc4x</groupId> <artifactId>plc4j-transports-tcp</artifactId> <version>1.0.0</version> </dependency> |
|||
Config options: |
||||
|
INT |
5000 |
Connection timeout in milliseconds. |
|
|
INT |
0 |
Socket read timeout in milliseconds. 0 means no timeout. |
|
|
INT |
0 |
Socket write timeout in milliseconds. 0 means no timeout. |
|
|
BOOLEAN |
true |
Enable TCP_NODELAY (disable Nagle’s algorithm). |
|
|
BOOLEAN |
false |
Enable SO_KEEPALIVE. |
|
|
INT |
81920 |
Send buffer size in bytes. 0 uses system default. |
|
|
INT |
81920 |
Receive buffer size in bytes. 0 uses system default. |
|
|
STRING |
Local address to bind to (optional). If not set, uses default. |
||
|
INT |
0 |
Local port to bind to (optional). 0 uses ephemeral port. |
|
The options above are the ones this transport declares. Some drivers add their own on top of
them - the ADS driver, for instance, adds AMS options to tcp - and those are listed in that
driver’s table on its protocol page.