| 7 | import java.net.URI; |
| 8 | |
| 9 | public 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected