예제 #1
0
 @Override
 public void update(Observable o, Object arg) {
   String message = arg.toString();
   if (message.equals("disconnected")) {
     System.out.println("The websocket got disconnected, reconnecting.");
     ws.connect();
   }
   System.out.println("got a message: " + arg);
 }
예제 #2
0
 public BitsoWebSocketExample() {
   Channels[] subscribeTo = {Channels.TRADES, Channels.DIFF_ORDERS, Channels.ORDERS};
   ws = new BitsoWebSocket(subscribeTo);
   ws.addObserver(this);
   ws.connect();
 }