As the title says, I dont get "No Response" message when the connection is lost

But what i want is when the connection is lost response is not null so its not throwing an exception in AbstractModbusMaster class' getAndCheckResponse() method. Because even though the connection is lost, its returning the same response over and over.

And program doesnt give me any exceptions or anything. Just repeating over same response.

So I had the idea to check the transactionId and if its the same I'd be throwing an exception.
I changed my code and used transaction.

But when I execute the transaction, its transaction.getResponse() is null.

Please help

 

Last edit: Samed Sivaslioglu 2017-12-07