Closed lorenzodonini closed 3 years ago
@andig feel free to have a look at this, if you want.
I'll be working on integrating this properly with the ocpp-j layer and add some further improvements on a separate branch.
feel free to have a look at this, if you want.
I just glanced over it but didn't try. From the comments you can see that I did not entirely grasp how you've designed this to work, please feel free to ignore the comments if not relevant.
feel free to have a look at this, if you want.
I just glanced over it but didn't try. From the comments you can see that I did not entirely grasp how you've designed this to work, please feel free to ignore the comments if not relevant.
Feedback is always appreciated :) Pushed some changes already. If something is still unclear, let me know
Implements auto-reconnect behavior for client websockets, as requested in https://github.com/lorenzodonini/ocpp-go/issues/38.
Implementation details
ClientTimeoutConfig
SetDisconnectedHandler
andSetReconnectedHandler
allow to register handlers for being notified of the respective eventsKnown Issues
This new feature only affects the
websocket
package and is not yet fully integrated by the ocpp-j package.The OCPP library will work as before, but upon reconnection, no retransmissions are triggered and no pending requests are cancelled. This will be tackled in a future PR.
Connection tests
Tests for network errors were added, to simulate connection drops.
Toxiproxy is being used as a service for this purpose.