Last active
January 3, 2021 15:37
-
-
Save kalaiyarasiganeshalingam/f2bade3f23c6e0d0beee243795ecdc4d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ballerina/io; | |
| import ballerina/http; | |
| public function main() { | |
| http:WebSocketClient wsClientEp = new("ws://localhost:9090/websocket", config = {callbackService: ClientService}); | |
| checkpanic wsClientEp->pushText("hello"); | |
| } | |
| service ClientService =@http:WebSocketServiceConfig {} service { | |
| resource function onText(http:WebSocketClient conn, string text, boolean finalFrame) { | |
| io:println(text); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment