Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout read operation closing TCPClient connection #69

Open
GoogleCodeExporter opened this issue Nov 12, 2015 · 1 comment
Open

Timeout read operation closing TCPClient connection #69

GoogleCodeExporter opened this issue Nov 12, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Connect to a tcp slave modbus device with a non infinite read timeout 
TCPClient (to test I connect to a tcp terminal, so that is no response to 
queries)
2. Send a readHoldingRegister message
3. Wait timeout

What is the expected output? What do you see instead?

Expected: Exception - read timeout. 

Received: Exception - Operation Invalid. Connection closed.

What version of the product are you using? On what operating system?

NModbus_net-3.5_1.11.0.0-source on Windows 7 Pro x64

Please provide any additional information below.

Looking at the code, I discovered that the retry mechanism catches the 
exception timeout and repeat the operation, but on the second attempt the TCP 
connection is closed for some reason and another exception is generated, 
masking the first one.

Original issue reported on code.google.com by [email protected] on 5 Feb 2014 at 7:22

@GoogleCodeExporter
Copy link
Author

I resolved closing Tcp connection and disposing the ModbusIpMaster object.
At next ping success, if you create new ModbusIpMaster object you will restore 
the connection to the device

Original comment by [email protected] on 30 Apr 2014 at 8:26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant