Closed michaelbeaumont closed 3 years ago
I honestly like the second idea better, because it allows to access everything in the same callback. The information can easily be passed all the way to the application. It would be a breaking change in the interface though, so up for debate. Btw I'm currently working on some improvements in the websocket package, so I could add your suggestion there directly in that case.
So to be clear, adding it to ws.Channel
? I actually like that option better as well.
So to be clear, adding it to
ws.Channel
? I actually like that option better as well.
Yes, that's right
Changes look good. The TLS field is not exposed yet to the callback in the ocpp1.6/2.0
package (only the client ID is being passed there). I can take care of it in a follow-up PR, if you want.
Good point! I can do the PR now, I'll pass the ws.Channel
to all the Server
handlers.
Good point! I can do the PR now, I'll pass the
ws.Channel
to all theServer
handlers.
I merged this PR in the meantime. It's gonna be quite a few changes, since you'll need to change the callback's signature, so I thought it would be best to keep it separate.
This is one way of doing it, another would be to stash the
tls.ConnectionState
in theWebSocket
and add an accessor.