Automatic reconnection and concurrency improvements
Pre-release
Pre-release
Breaking changes
The following interfaces in the ocppj package changed slightly, affecting existing custom implementations:
- ClientDispatcher
- ServerDispatcher
PendingRequestState
was split intoClientState
andServerState
ocppj.NewClient
andocppj.NewServer
now accept the respective state interface
Websocket clients now include the following new methods:
SetDisconnectedHandler
SetReconnectedHandler
IsConnected
Additions & improvements
- Client websockets automatically reconnect to server after connection loss
- Added network tests for re-connection and timeouts
- Added full support for concurrent requests in ocpp16 and ocpp2
- Automatically clear all callbacks when a charge point/central system is stopped
- Improved test coverage for websockets
- Improved test coverage for ocpp-j layer
- Added logger interface for getting library debug logs
- Added TLS connection state accessor to websocket
Channel
struct - Use slices instead of linked lists in FIFO queues
Bugfixes
- Fixed concurrency issues in websockets
- Fixed concurrency and state management issues in ocpp-j dispatchers
- Fixed concurrency issues in ocpp16 package
- Fixed several nil panics in websockets, ocppj and dispatcher
- Don't set
clientReadyMap
status in request dispatcher if not ready - Notify charge point of failed requests with
onRequestTimeout
callbacks