public class ModbusUDPTransport extends AbstractModbusTransport
| Constructor and Description |
|---|
ModbusUDPTransport(AbstractUDPTerminal terminal)
Constructs a new ModbusTransport instance,
for a given UDPTerminal.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the raw input and output streams of
this ModbusTransport.
|
ModbusTransaction |
createTransaction()
Creates a Modbus transaction for the underlying transport.
|
ModbusRequest |
readRequest(AbstractModbusListener listener)
Reads a ModbusRequest from the
input stream of this ModbusTransport.
|
ModbusResponse |
readResponse()
Reads a ModbusResponse from the
input stream of this ModbusTransport.
|
void |
setTimeout(int time)
Set the socket timeout
|
void |
writeRequest(ModbusRequest msg)
Writes a ModbusMessage to the
output stream of this ModbusTransport.
|
void |
writeResponse(ModbusResponse msg)
Writes a ModbusResponseMessage to the
output stream of this ModbusTransport.
|
public ModbusUDPTransport(AbstractUDPTerminal terminal)
terminal - the UDPTerminal used for message transport.public void setTimeout(int time)
AbstractModbusTransportsetTimeout in class AbstractModbusTransporttime - Timeout in millisecondspublic void close()
throws IOException
AbstractModbusTransportclose in class AbstractModbusTransportIOException - if a stream
cannot be closed properly.public ModbusTransaction createTransaction()
AbstractModbusTransportcreateTransaction in class AbstractModbusTransportpublic void writeResponse(ModbusResponse msg) throws ModbusIOException
AbstractModbusTransportwriteResponse in class AbstractModbusTransportmsg - a ModbusMessage.ModbusIOException - data cannot be
written properly to the raw output stream of
this ModbusTransport.public void writeRequest(ModbusRequest msg) throws ModbusIOException
AbstractModbusTransportwriteRequest in class AbstractModbusTransportmsg - a ModbusMessage.ModbusIOException - data cannot be
written properly to the raw output stream of
this ModbusTransport.public ModbusRequest readRequest(AbstractModbusListener listener) throws ModbusIOException
AbstractModbusTransportreadRequest in class AbstractModbusTransportlistener - Listener the request was received byModbusIOException - data cannot be
read properly from the raw input stream of
this ModbusTransport.public ModbusResponse readResponse() throws ModbusIOException
AbstractModbusTransportreadResponse in class AbstractModbusTransportModbusIOException - data cannot be
read properly from the raw input stream of
this ModbusTransport.Copyright © 2025. All Rights Reserved.