goburrow / modbus

Fault-tolerant implementation of modbus protocol in Go (golang)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to tell if server closes the connection?

Prushka opened this issue · comments

commented

In my test, once the server forces a disconnection, the local conn will still be set and all client operations will fail.
mb.connect() doesn't get triggered in this case.

I couldn't find anything regarding this in the library. I had to check client calls for errors and manually close and connect.
Is this intended? Is there a better way to achieve this (e.g., check for broken pipe errors and reconnect)?