Closed tvraghavan closed 6 years ago
I've added a test case to the code that tests this specific issue and I can't replicate it.
Take a look at TestModbusSerialRTUMasterRead.testBadCommsPort()
The call master.readInputRegisters(UNIT_ID, 0, 5)
tries 5 times to get through and comes back after about 9 seconds.
Try out the v2.5.1 snapshot and let me know if there is still an issue.
No response for over 2 months so I'm closing this ticket
Expected Behavior
Am testing my code against a modBus simulator (mod_RSsim.exe from Embedded Intelligence) The purpose of my code is to read the data inputRegister from specific address
As part of the testing, I've created simulated USB ports (COM6) in my Windows7 OS and use RSsim modbus simulator to simulate inputRegister data.
Now, when the simulator is down, however (COM6) port is up. the readInputRegister(unitID, refID, readCount) waits forever and does not timeout the read call.
Expected behavior is to timeout the readInputRegister() or support a timeout feature
Note: I tried to move the logic to a Callable implementation and tried to stop the child thread (future.cancel(true)). Even this does not terminate the readInputRegister() call.
Actual Behavior
readInputRegister() stays blocked
Steps to Reproduce the Problem
Code snippet
Specifications