lorenzodonini / ocpp-go

Open Charge Point Protocol implementation in Go
MIT License
275 stars 126 forks source link

Don't call ocppj.Dispatcher after server stopped #90

Open michaelbeaumont opened 3 years ago

michaelbeaumont commented 3 years ago

After dispatcher.Stop is called, dispatcher.DeleteClient will block. Since we give up control over when onClientConnected/Disconnected are called, we need to first signal not to call DeleteClient anymore (stopped chan struct{}) and wait until any in progress calls are finished, then we can call Stop.

This is one solution at least.