MCPcopy Index your code
hub / github.com/socketio/socket.io-client-java / Fiddle

Class Fiddle

src/test/java/io/socket/Fiddle.java:9–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7import java.net.URI;
8
9public class Fiddle {
10
11 public static void main(String[] argz) throws Exception {
12 IO.Options options = new IO.Options();
13
14 Socket socket = IO.socket(URI.create("http://localhost:3000"), options);
15
16 socket.on(Socket.EVENT_CONNECT, new Emitter.Listener() {
17 @Override
18 public void call(Object... args) {
19 System.out.println("connect");
20 }
21 });
22
23 socket.on(Socket.EVENT_CONNECT_ERROR, new Emitter.Listener() {
24 @Override
25 public void call(Object... args) {
26 System.out.println("connect_error: " + args[0]);
27 }
28 });
29
30 socket.on(Socket.EVENT_DISCONNECT, new Emitter.Listener() {
31 @Override
32 public void call(Object... args) {
33 System.out.println("disconnect due to: " + args[0]);
34 }
35 });
36
37 socket.connect();
38 }
39}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected