app/controllers/WS.java
@Override
		public void onReady(WebSocket.In<JsonNode> in,
				WebSocket.Out<JsonNode> out) {

			channels.add(out);

			// When the message come.
			in.onMessage(new Callback<JsonNode>() {
				@Override
				public void invoke(JsonNode event) {
				}
			});

			// When the socket is closed.
			in.onClose(new Callback0() {
				@Override
				public void invoke() {
					ObjectNode event = Json.newObject();
					event.put("connection", "disconnected");
				}
			});

			ObjectNode event = Json.newObject();
			event.put("connection", "estabilished");
			out.write(event);
		}
// called when the websocket is established
called when the websocket is established
called when the websocket is established
@Override
		public void onReady(WebSocket.In<JsonNode> in,
				WebSocket.Out<JsonNode> out) {
			channels.add(out);
			in.onMessage(new Callback<JsonNode>() {
				@Override
				public void invoke(JsonNode event) {
				}
			});
			in.onClose(new Callback0() {
				@Override
				public void invoke() {
					ObjectNode event = Json.newObject();
					event.put("connection", "disconnected");
				}
			});
			ObjectNode event = Json.newObject();
			event.put("connection", "estabilished");
			out.write(event);
		}
@ Override public void onReady ( WebSocket . In < JsonNode > in , WebSocket . Out < JsonNode > out ) { channels . add ( out ) ; in . onMessage ( new Callback < JsonNode > ( ) { @ Override public void invoke ( JsonNode event ) { } } ) ; in . onClose ( new Callback0 ( ) { @ Override public void invoke ( ) { ObjectNode event = Json . newObject ( ) ; event . put ( "connection" , "disconnected" ) ; } } ) ; ObjectNode event = Json . newObject ( ) ; event . put ( "connection" , "estabilished" ) ; out . write ( event ) ; }
called when the websocket is established
called when the websocket is established
// When the message come. // When the socket is closed.