T. Langhorst created PLC4X-188:
----------------------------------
Summary: Connection doesn't close
Key: PLC4X-188
URL: https://issues.apache.org/jira/browse/PLC4X-188
Project: Apache PLC4X
Issue Type: Bug
Components: Driver-Modbus
Affects Versions: 0.6.0
Reporter: T. Langhorst
I use the following code:
{code:java}
String connectionString = "modbus:tcp://localhost:502";
try(PlcConnection connection = new
PlcDriverManager().getConnection(connectionString)) {
if (!connection.getMetadata().canRead()) {
System.out.println("This connection doesn't support reading.");
return;
}
PlcReadRequest request = connection.readRequestBuilder()
.addItem("c1", "coil:1")
.build();
PlcReadResponse resp = request.execute().get();
boolean coil = resp.getBoolean("c1");
System.out.println("Status of coil 1: " + coil);
} catch (InterruptedException | ExecutionException | PlcConnectionException e) {
e.printStackTrace();
}
{code}
But the program just doesn't exit after the request is finished.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)