You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ go run main.go
Server is running...
2024/09/10 16:52:10 serial read error serial: timeout
^CStopping server...
Server stopped
Note that I was able to read/write several coils with no problem. But if I wait longer than the timeout period to issue another command, I get the serial read error, and all subsequent requests to the server fail. However, I am able to close the server down cleanly.
$ go run main.go
Server is running...
^CStopping server...
signal: terminated
I am able to read/write many times, with large gaps in between with no issues. Note that the server only shuts down cleanly now when a kill <pid> is issued. The program hangs on serv.Close().
It seems there is some sort of deadlock here. I noticed in the docs a section on Race Conditions, however I'm not doing anything with goroutines here and the version with a timeout works just fine.
The text was updated successfully, but these errors were encountered:
I'm trying to test out the RTU Server.
If I specify a timeout, the server is unstable: it either times out before the client connects or closes if requests are not made often enough.
If I don't specify a timeout, the server seems to work great, but calling Close seems to block forever and I can't cleanly shut it down.
With timeout speciffied
Output
$ go run main.go Server is running... 2024/09/10 16:52:10 serial read error serial: timeout ^CStopping server... Server stopped
Note that I was able to read/write several coils with no problem. But if I wait longer than the timeout period to issue another command, I get the serial read error, and all subsequent requests to the server fail. However, I am able to close the server down cleanly.
Without timeout
I am able to read/write many times, with large gaps in between with no issues. Note that the server only shuts down cleanly now when a
kill <pid>
is issued. The program hangs onserv.Close()
.It seems there is some sort of deadlock here. I noticed in the docs a section on Race Conditions, however I'm not doing anything with goroutines here and the version with a timeout works just fine.
The text was updated successfully, but these errors were encountered: