lorenzodonini / ocpp-go

Open Charge Point Protocol implementation in Go
MIT License
262 stars 125 forks source link

Use contexts to pop requests when a msg at context.Done is received #113

Closed utsavanand2 closed 4 months ago

utsavanand2 commented 3 years ago

Ref issue #66

Hi @lorenzodonini ! I created a PR for cancelling and removing request that originate from server to client, with ref to the in progress PR already done by @michaelbeaumont for cancelling requests. (Thanks Mike!).

I tried my changes with a Raspberry Pi that sleeps for 30 secs for some requests which is more than the timeout of the context that I pass with context.WithTimeout(). From the logs I can see the request getting removed, but for some reason the next requests still remain pending. I don't know what I'm missing, I'm fairly new to the library so I would really appreciate any guidance or help to make it better.

Thanks!

Screenshot 2021-08-13 at 7 47 19 PM

Signed-off-by: Utsav Anand utsavanand2@gmail.com