Package org.jboss.netty.handler.codec.http.websocketx

Examples of org.jboss.netty.handler.codec.http.websocketx.PongWebSocketFrame


        // Check for closing frame
        if (frame instanceof CloseWebSocketFrame) {
            this.handshaker.close(ctx.getChannel(), (CloseWebSocketFrame) frame);
            return false;
        } else if (frame instanceof PingWebSocketFrame) {
            ctx.getChannel().write(new PongWebSocketFrame(frame.getBinaryData()));
            return false;
        } else if (!(frame instanceof TextWebSocketFrame)) {
            throw new UnsupportedOperationException(String.format("%s frame types not supported", frame.getClass()
                    .getName()));
        }
View Full Code Here


      WebSocket socket = WebSocketStore.defaultWebSocketStore().socketForChannel(e.getChannel());
          if (frame instanceof CloseWebSocketFrame) {
            //TODO remove from store?
              handshaker.close(ctx.getChannel(), (CloseWebSocketFrame) frame);
          } else if (frame instanceof PingWebSocketFrame) {
              ctx.getChannel().write(new PongWebSocketFrame(frame.getBinaryData()));
          } else if(socket != null) {
        socket.receiveFrame(frame);
      }
    }
View Full Code Here

   }

   private void handleWebSocketFrame(ChannelHandlerContext ctx, WebSocketFrame frame) {
      if (frame instanceof PingWebSocketFrame) {
         // received a ping, so write back a pong
         ctx.getChannel().write(new PongWebSocketFrame(frame.getBinaryData()));
      } else if (frame instanceof CloseWebSocketFrame) {
         // request to close the connection
         handshaker.close(ctx.getChannel(), (CloseWebSocketFrame) frame);
      } else {
         try {
View Full Code Here

        // Check for closing frame
        if (frame instanceof CloseWebSocketFrame) {
            this.handshaker.close(ctx.getChannel(), (CloseWebSocketFrame) frame);
            return;
        } else if (frame instanceof PingWebSocketFrame) {
            ctx.getChannel().write(new PongWebSocketFrame(frame.getBinaryData()));
            return;
        } else if (!(frame instanceof TextWebSocketFrame)) {
            throw new UnsupportedOperationException(String.format("%s frame types not supported", frame.getClass()
                    .getName()));
        }
View Full Code Here

TOP

Related Classes of org.jboss.netty.handler.codec.http.websocketx.PongWebSocketFrame

Copyright © 2018 www.massapicom. 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.