Open andig opened 1 year ago
I have- for sake of speed and being opinionated in terms of which changes were needed- created a fork at https://github.com/andig/mbserver. The main changes are:
binary.ByteOrder
gofmt
ed everythingMy changes (which are really to large part removal) are in https://github.com/andig/mbserver. If this should be of any interest please let me know if PRs would be of interest. If possible I'd like not having to maintain a fork.
Thanks for the heads up andig. I'll dig into your fork and see if there's anything there for me to backport.
Out of interest, what custom TLS handling is your application doing?
Really no TLS handling. I've sort of come from the "I want to determine the listener" side. Once I do that I can't have the TLS handling in the library. If that breaks things it may not be the way to go but is good enough for my purposes.
I've opened https://github.com/simonvetter/modbus/pull/21 if you want to take a look. I've not rewritten the server tests yet as I'd need to migrate them to the grid-x client (or use simonvetter/modbus ;). The whole exercise allows to use the server component for building a modbus proxy in https://github.com/evcc-io/evcc/pull/4981. Having the proxy allows for sharing the modbus connection for devices that otherwise allow a single client only.
@simonvetter I'd be happy to open a PR for gofmt
and maybe golangcilint
- that would already make the diff much smaller.
It would be nice- especially for testing- if an existing listener could be used instead of the server creating it's own listener. Doing so would also externalise the entire TLS checking/handling.