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

Add Close Frame Record return type support #1497

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

chathushkaayash
Copy link

@chathushkaayash chathushkaayash commented Feb 11, 2025

Purpose

$subject

Resolves Add support for websocket close frame

Examples

1. Close the connection using NormalClosure

remote function onMessage(websocket:Caller caller, string data) returns websocket:NormalClosure {
    // ... omitted for brevity
    return websocket:NORMAL_CLOSURE;
}

2. Close the connection using CustomCloseFrame

remote function onMessage(websocket:Caller caller, string data) returns websocket:CustomCloseFrame {
    // ... omitted for brevity
    return {status: 3555, reason: "Custom close frame message"};
}

Checklist

  • Linked to an issue
  • Updated the specification
  • Updated the changelog
  • Added tests
  • Checked native-image compatibility

@ayeshLK ayeshLK marked this pull request as ready for review February 19, 2025 04:52
@ayeshLK ayeshLK requested review from Bhashinee and removed request for shafreenAnfar and ThisaruGuruge February 19, 2025 04:52
Comment on lines 1155 to 1156
String objectType = ((BObject) bMap.get(WebSocketConstants.CLOSE_FRAME_TYPE))
.getOriginalType().toString();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIR we have a runtime API called TypeUtils.getType to get the type of a BObject. Shall we use that here ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for websocket close frame
3 participants