Examples of WebSocketFrame


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

    Object message = ((MessageEvent)e).getMessage();
    if(!(message instanceof JSONObject) && !(message instanceof CharSequence)) {
            ctx.sendDownstream(e);
            return;     
    }
    WebSocketFrame frame = new TextWebSocketFrame(message.toString());   
    ctx.sendDownstream(new DownstreamMessageEvent(channel, Channels.future(channel), frame, channel.getRemoteAddress()));   

  }
View Full Code Here

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

            HttpResponse response = (HttpResponse) e.getMessage();
            throw new Exception("Unexpected HttpResponse (status=" + response.getStatus()
                    + ", content=" + response.getContent().toString(CharsetUtil.UTF_8) + ')');
        }

        WebSocketFrame frame = (WebSocketFrame) e.getMessage();
        if (frame != null)
            queue.offer(frame);
    }
View Full Code Here

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

    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
        Object msg = e.getMessage();
        if (msg instanceof HttpRequest) {
            handleHttpRequest(ctx, (HttpRequest) msg);
        } else if (msg instanceof WebSocketFrame) {
            WebSocketFrame frame = (WebSocketFrame)msg;
            boolean handle = handleWebSocketFrame(ctx, frame);
            if (handle) {
                Channels.fireMessageReceived(ctx, frame.getBinaryData());
            }
        }
    }
View Full Code Here

Examples of org.vertx.java.core.http.impl.ws.WebSocketFrame

    if (data.isWrapper()) {
      // call retain to make sure it is not released before the write completes
      // the write will call buf.release() by it own
      buf.retain();
    }
    WebSocketFrame frame = new DefaultWebSocketFrame(WebSocketFrame.FrameType.BINARY, buf);
    writeFrame(frame);
  }
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.