public class TCPSlaveConnection extends Object
| Constructor and Description |
|---|
TCPSlaveConnection(Socket socket)
Constructs a TCPSlaveConnection instance using a given socket
instance.
|
TCPSlaveConnection(Socket socket,
boolean useRtuOverTcp)
Constructs a TCPSlaveConnection instance using a given socket
instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this TCPSlaveConnection.
|
InetAddress |
getAddress()
Returns the destination InetAddress of this
TCPSlaveConnection.
|
long |
getLastActivityTimestamp() |
AbstractModbusTransport |
getModbusTransport()
Returns the ModbusTransport associated with this
TCPMasterConnection.
|
int |
getPort()
Returns the destination port of this TCPSlaveConnection.
|
int |
getTimeout()
Returns the timeout for this TCPSlaveConnection.
|
boolean |
isConnected()
Tests if this TCPSlaveConnection is connected.
|
void |
setTimeout(int timeout)
Sets the timeout for this TCPSlaveConnection.
|
public TCPSlaveConnection(Socket socket)
socket - the socket instance to be used for communication.public TCPSlaveConnection(Socket socket, boolean useRtuOverTcp)
socket - the socket instance to be used for communication.useRtuOverTcp - True if the RTU protocol should be used over TCPpublic void close()
public AbstractModbusTransport getModbusTransport()
public long getLastActivityTimestamp()
ModbusTCPTransport.getLastActivityTimestamp(),
System.nanoTime()public int getTimeout()
public void setTimeout(int timeout)
timeout - the timeout in milliseconds as int.public int getPort()
public InetAddress getAddress()
public boolean isConnected()
Copyright © 2025. All Rights Reserved.