public class ModbusTCPListener extends AbstractModbusListener
If listening, it accepts incoming requests passing them on to be handled. If not listening, silently drops the requests.
| Constructor and Description |
|---|
ModbusTCPListener(int poolsize)
/**
Constructs a ModbusTCPListener instance.
|
ModbusTCPListener(int poolsize,
boolean useRtuOverTcp)
/**
Constructs a ModbusTCPListener instance.
|
ModbusTCPListener(int poolsize,
InetAddress addr)
Constructs a ModbusTCPListener instance.
|
ModbusTCPListener(int poolsize,
InetAddress addr,
boolean useRtuOverTcp)
Constructs a ModbusTCPListener instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
run() |
void |
setMaxIdleSeconds(int maxIdleSeconds)
Sets a maximum time a connection can be idle, i.e.
|
void |
setTimeout(int timeout)
Sets the socket timeout
|
void |
stop()
Stop the listener thread for this ModbusListener instance.
|
getAddress, getError, getPort, getProcessImage, getThreadName, getTimeout, isListening, setAddress, setListening, setPort, setThreadNamepublic ModbusTCPListener(int poolsize,
InetAddress addr)
poolsize - the size of the ThreadPool used to handle incoming
requests.addr - the interface to use for listening.public ModbusTCPListener(int poolsize,
InetAddress addr,
boolean useRtuOverTcp)
poolsize - the size of the ThreadPool used to handle incoming
requests.addr - the interface to use for listening.useRtuOverTcp - True if the RTU protocol should be used over TCPpublic ModbusTCPListener(int poolsize)
poolsize - the size of the ThreadPool used to handle incoming
requests.public ModbusTCPListener(int poolsize,
boolean useRtuOverTcp)
poolsize - the size of the ThreadPool used to handle incoming
requests.useRtuOverTcp - True if the RTU protocol should be used over TCPpublic void setMaxIdleSeconds(int maxIdleSeconds)
maxIdleSeconds of total silence.
This option is disabled by default (maxIdleSeconds == 0)maxIdleSeconds - 0 to disable watchdog, or a positive number to set it.public void setTimeout(int timeout)
AbstractModbusListenersetTimeout in class AbstractModbusListenertimeout - Timeout in millisecondspublic void run()
public void stop()
AbstractModbusListenerstop in class AbstractModbusListenerCopyright © 2025. All Rights Reserved.