-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow ping handler to be set on ServerWebScoket #4794
Comments
I think we could check in the |
Apologies, but I'm not totally following. Wouldn't I still lose my frame handler with this: serverWebSocket The other issue with using a frame handler to monitor pings is that I have to re-implement FrameAggregator and attach text/binary handlers to my implementation. Is there something I'm missing which makes this problematic?: serverWebSocket |
…e binary/text frames, this overrides a frame handler that could be set to handle frames in addition of processing them. The implementation has been modified so that the frame aggregator for binary/text frames has its own handler, the frame aggregator and the frame handler are both notified with incoming frames. fixes #4794
…e binary/text frames, this overrides a frame handler that could be set to handle frames in addition of processing them. The implementation has been modified so that the frame aggregator for binary/text frames has its own handler, the frame aggregator and the frame handler are both notified with incoming frames. fixes #4794
Actually it looks simpler to simply have a field FrameAggregator in addition of the frameHandler : #4799 |
…e binary/text frames, this overrides a frame handler that could be set to handle frames in addition of processing them. The implementation has been modified so that the frame aggregator for binary/text frames has its own handler, the frame aggregator and the frame handler are both notified with incoming frames. fixes #4794
Describe the feature
Allow a ping handler to be specified on a ServerWebSocket (similar to pongHandler)
Use cases
Currently the ServerWebSocket responds to a ping with a pong:
// Echo back the content of the PING frame as PONG frame as specified in RFC 6455 Section 5.5.2
conn.writeToChannel(new PongWebSocketFrame(frame.getBinaryData().copy()));
We've had a use case where a user (either inadvertently or deliberately) flooded our websockets with 1000s of pings/sec. It would be nice to be able to monitor the number of pings a client web socket is sending.
We can get hold of this information if we add a framehandler to the websocket. The only issue with that is if you want to specify a text/binary message handler, the frame handler is overridden.
Contribution
Happy to supply a PR if required.
The text was updated successfully, but these errors were encountered: