When creating a ModbusTCPListener it accepts to set a timeout for incoming connections but this timeout is not propagated to TCPSlaveConnections.
This means that when you set the timeout of the ModbusTCPListener only affects the original server socket that is listening for connections, but the slave sockets assigned to each incoming connections maintain the Modbus.DEFAULT_TIMEOUT of 3 seconds and it is not possible to change it.
Changing the TCPSlaveConnection timeout is very useful to avoid closing the established master connections after 3 seconds.
I would say that probably most users of the library would expect that when they change the timeout of the listener it will affect also the slave connections created.
It would be possible to set the two timeouts separately but I can not think of many situations where this would be useful, so propagating the timeout seems the most straightforward solution.
When creating a ModbusTCPListener it accepts to set a timeout for incoming connections but this timeout is not propagated to TCPSlaveConnections.
This means that when you set the timeout of the ModbusTCPListener only affects the original server socket that is listening for connections, but the slave sockets assigned to each incoming connections maintain the Modbus.DEFAULT_TIMEOUT of 3 seconds and it is not possible to change it.
Changing the TCPSlaveConnection timeout is very useful to avoid closing the established master connections after 3 seconds.
I would say that probably most users of the library would expect that when they change the timeout of the listener it will affect also the slave connections created.
It would be possible to set the two timeouts separately but I can not think of many situations where this would be useful, so propagating the timeout seems the most straightforward solution.