Uses 115K of libraries. Click here for Pure Java version (949L/7K/24K).
1 | !7 |
2 | |
3 | lib 1014685 // websocket |
4 | |
5 | import org.java_websocket.client.WebSocketClient; |
6 | import org.java_websocket.handshake.ServerHandshake; |
7 | |
8 | p {
|
9 | WebSocketClient client = new WebSocketClient(new URI("ws://butter.botcompany.de:8080/1014677")) {
|
10 | public void onMessage( String message ) {
|
11 | print("message from server: " + message);
|
12 | } |
13 | |
14 | public void onOpen( ServerHandshake handshake ) {
|
15 | print("opened connection");
|
16 | } |
17 | |
18 | public void onClose(int code, S reason, bool remote) {
|
19 | print("closed connection");
|
20 | } |
21 | |
22 | public void onError(Exception e) {
|
23 | printStackTrace(e); |
24 | } |
25 | }; |
26 | |
27 | assertTrue("connect", client.connectBlocking());
|
28 | } |
Began life as a copy of #1009221
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1014686 |
| Snippet name: | WebSocket Client Test 2 (OK, but no auto-reconnect) |
| Eternal ID of this version: | #1014686/3 |
| Text MD5: | 09c00b534b57cb1ba18e91a5f275f6fb |
| Transpilation MD5: | 482661c301421ce0c32ec3eaa9de7c5b |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX source code |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-04-30 01:19:26 |
| Source code size: | 692 bytes / 28 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 615 / 783 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |