Package com.nhncorp.mods.socket.io.impl

Examples of com.nhncorp.mods.socket.io.impl.Namespace.emit()


    final Namespace chat = io.of("/chat");
    chat.onConnection(new Handler<SocketIOSocket>() {
      public void handle(SocketIOSocket socket) {
        socket.on("namespace emit", new Handler<JsonObject>() {
          public void handle(JsonObject event) {
            chat.emit("msg", new JsonObject().putString("everyone", "in").putString("/chat", "will get"));
          }
        });
      }
    });
View Full Code Here


          public void handle(SocketIOSocket socket) {
            socket.on("message", new Handler<JsonObject>() {
              @Override
              public void handle(JsonObject event) {
                System.out.println(event);
                namespace.emit("message", event.getString("data"));
              }
            });
          }
        });
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.