Closed tiagocoutinho closed 3 years ago
Thanks for you suggestion!
I don't like to change to default port of the client, as Modbus server are usually listening to port 502. Changing only the port of the server would make the example server incompatible with the example client. Therefore I also don't want to change the port of the example server.
But I realize it's not very friendly to just let the server crash. Therefore I suggest 2 thinks to make the server more user friendly, but keeping default port at 502.
1) Catch the exception PermissionError
, print a user friendly message to the user and exit.
2) Add am option to modify the used port from the command line.
Sounds good! Should the README examples be changed as well? Or, for the sake of readability, you prefer to keep them as is?
Please update the README.md as well. I expect that a significant amount of users just copy the code from the README.md. Although I don't have proof to back it up
I think it should be ready to review now
It would be nice if the examples work out of the box without the user needing access to tcp port 502.
I propose using
15020
in this PR but I could change to something else if you prefer