Azure / qpid-proton-j-extensions

Extends qpid-proton-j library to talk AMQP over WEBSOCKETS
MIT License
6 stars 13 forks source link

[Question] Does the WebSocket implementation respond to empty pings? #52

Open jamdavi opened 3 years ago

jamdavi commented 3 years ago

My first inkling is it doesn't. Looking at this snippet below it seems as if if the ping request doesn't have any application data we don't send a proper pong.

It's possible this is part of the Ping/Pong spec and I'm not aware of it.

What I would assume here is if the buffer is empty we just place the FIN | PONG flags on the buffer and send it.

https://github.com/Azure/qpid-proton-j-extensions/blob/8c715f311af7c48f577ae6af2edf4275f855a65b/src/main/java/com/microsoft/azure/proton/transport/ws/impl/WebSocketHandlerImpl.java#L33-L52

conniey commented 3 years ago

I'm not entirely sure. I inherited this repository... I do see some code to handle a state for WS_CONNECTED_PONG. https://github.com/Azure/qpid-proton-j-extensions/blob/master/src/main/java/com/microsoft/azure/proton/transport/ws/impl/WebSocketImpl.java#L300