Skip to content
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

respond to close frame with custom close code in jetty-10 websocket #4502

Closed
lachlan-roberts opened this issue Jan 21, 2020 · 1 comment · Fixed by #4523
Closed

respond to close frame with custom close code in jetty-10 websocket #4502

lachlan-roberts opened this issue Jan 21, 2020 · 1 comment · Fixed by #4523
Assignees

Comments

@lachlan-roberts
Copy link
Contributor

Jetty version
10.0.x

Description
Cannot send frames or use the Session from Jetty WebSocket onWebSocketClose event or the java.websocket onClose event. In these events you should be able to do things like send back an alternate close code to the one received.

This is currently working in jetty-9.4.x but not jetty-10.0.x. It was assumed that the onClose events are equivalent of the websocket-core FrameHandler.onClosed. Core has the capability of receiving a close frame in onFrame and responding to it with a custom close code, but this is difficult with the jetty API and not possible with our javax websocket implementation.

@lachlan-roberts
Copy link
Contributor Author

@sbordet the jetty ws API does have the WebSocketFrameListener interface which will allow you to handle a close frame how you would like.

@lachlan-roberts lachlan-roberts self-assigned this Jan 21, 2020
lachlan-roberts added a commit that referenced this issue Jan 29, 2020
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Jan 29, 2020
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Jan 29, 2020
Issue #4502 - allow changing of close response from jetty and javax websocket onClose events
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant