I have observed some cases where a modbus request sent by jlibmodbus was delayed for several 100 ms. In case the delay is larger than the configured read timeout this leads to a SocketTimeoutException. Enabling TCP_NODELAY hopefully fixes this problem.
The Modbus specification (https://modbus.org/docs/Modbus_Messaging_Implementation_Guide_V1_0b.pdf chapter 4.3.2) recommends to use TCP_NODELAY so it should be enabled for all TCP connections.
I have observed some cases where a modbus request sent by jlibmodbus was delayed for several 100 ms. In case the delay is larger than the configured read timeout this leads to a SocketTimeoutException. Enabling TCP_NODELAY hopefully fixes this problem.