-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add Close Frame Record
return type support
#1497
base: main
Are you sure you want to change the base?
Conversation
* Update chat_application test results on Tue Feb 11 18:29:43 UTC 2025 * Update chat_application test results on Wed Feb 12 18:30:42 UTC 2025 --------- Co-authored-by: ballerina-bot <ballerina-bot@ballerina.org> Co-authored-by: ballerina-bot <ballerinalang@wso2.com>
Sync the fork
Sync the fork
native/src/main/java/io/ballerina/stdlib/websocket/WebSocketResourceDispatcher.java
Outdated
Show resolved
Hide resolved
Sync the fork
native/src/main/java/io/ballerina/stdlib/websocket/WebSocketResourceDispatcher.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
20eb8c2
|
result = wsService.getRuntime().callMethod( | ||
connectionInfo.getWebSocketEndpoint(), WebSocketConstants.RESOURCE_NAME_CLOSE, | ||
strandMetadata, status, reason); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we invoke the WebSocket close resource here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the user sends a close frame, we call this method to actually close the connection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but in this case we are the ones who send a close frame right? Not receiving a close frame. Isn't that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but in this case we are the ones who send a close frame right? Not receiving a close frame. Isn't that correct?
Correct. We send the close frame.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had an offline discussion with @Bhashinee and decided to implement a new sendCloseFrame
method instead of reusing externClose
.
Purpose
Resolves Add support for websocket close frame
Examples
1. Close the connection using
NormalClosure
2. Close the connection using
CustomCloseFrame
Checklist