Package io.netty.channel

Examples of io.netty.channel.ChannelPipeline.replace()


                    SaslServer server = this.server;
                    this.server = null;
                    // Replace this handler now with the QopHandler
                    // This is mainly done as the QopHandler itself will not block at all and so we can
                    // get rid of the usage of the EventExecutorGroup after the negation took place.
                    pipeline.replace(this, ctx.name(), new QopHandler(server));
                } else {
                    // there is no need for any QOP handling so we are done now and can just remove ourself from the
                    // pipeline
                    pipeline.remove(this);
                }
View Full Code Here


                        ctx = p.context(HttpServerCodec.class);
                        if (ctx == null) {
                            throw new IllegalStateException("No HttpDecoder and no HttpServerCodec in the pipeline");
                        }
                        p.addBefore(ctx.name(), "wsencoder", newWebsocketDecoder());
                        p.replace(ctx.name(), "wsdecoder", newWebSocketEncoder());
                    } else {
                        p.remove(HttpRequestDecoder.class);
                        p.remove(HttpResponseEncoder.class);
                    }
                } else {
View Full Code Here

                    if (future.isSuccess()) {
                        final ChannelPipeline pipeline = future.channel().pipeline();
                        pipeline.remove(SockJsHandler.class);
                        pipeline.remove(CorsInboundHandler.class);
                        pipeline.remove(CorsOutboundHandler.class);
                        pipeline.replace(WebSocketTransport.class, "websocket-ha-proxy",
                                new WebSocketHAProxyTransport(haHandshaker));
                        pipeline.addLast(new WebSocketSendHandler());
                    }
                }
            });
View Full Code Here

                        p.addBefore(ctx.name(), "wsencoder", newWebsocketDecoder());
                        p.replaceAndForward(ctx.name(), "wsdecoder", newWebSocketEncoder());
                    } else {
                        p.replaceAndForward(ctx.name(), "wsdecoder", newWebsocketDecoder());

                        p.replace(HttpResponseEncoder.class, "wsencoder", newWebSocketEncoder());
                    }
                    promise.setSuccess();
                } else {
                    promise.setFailure(future.cause());
                }
View Full Code Here

    ChannelHandler inflater = pipeline.get(HttpContentDecompressor.class);
    if (inflater != null) {
      pipeline.remove(inflater);
    }
    pipeline.remove("codec");
    pipeline.replace("handler", "handler", new VertxNetHandler(client.getVertx(), connectionMap) {
      @Override
      public void exceptionCaught(ChannelHandlerContext chctx, Throwable t) throws Exception {
        // remove from the real mapping
        client.removeChannel(channel);
        super.exceptionCaught(chctx, t);
View Full Code Here

        ChannelPipeline p = channel.getPipeline();
        if (p.get(HttpChunkAggregator.class) != null) {
            p.remove(HttpChunkAggregator.class);
        }

        p.replace(HttpRequestDecoder.class, "wsdecoder", new WebSocket08FrameDecoder(true, allowExtensions));
        p.replace(HttpResponseEncoder.class, "wsencoder", new WebSocket08FrameEncoder(false));

        return future;
    }
View Full Code Here

        if (p.get(HttpChunkAggregator.class) != null) {
            p.remove(HttpChunkAggregator.class);
        }

        p.replace(HttpRequestDecoder.class, "wsdecoder", new WebSocket08FrameDecoder(true, allowExtensions));
        p.replace(HttpResponseEncoder.class, "wsencoder", new WebSocket08FrameEncoder(false));

        return future;
    }

    /**
 
View Full Code Here

        // Upgrade the connection and send the handshake response.
        ChannelPipeline p = channel.getPipeline();
        if (p.get(HttpChunkAggregator.class) != null) {
            p.remove(HttpChunkAggregator.class);
        }
        p.replace(HttpRequestDecoder.class, "wsdecoder", new WebSocket00FrameDecoder());

        ChannelFuture future = channel.write(res);

        p.replace(HttpResponseEncoder.class, "wsencoder", new WebSocket00FrameEncoder());
View Full Code Here

        }
        p.replace(HttpRequestDecoder.class, "wsdecoder", new WebSocket00FrameDecoder());

        ChannelFuture future = channel.write(res);

        p.replace(HttpResponseEncoder.class, "wsencoder", new WebSocket00FrameEncoder());

        return future;
    }

    /**
 
View Full Code Here

        ChannelPipeline p = channel.getPipeline();
        if (p.get(HttpChunkAggregator.class) != null) {
            p.remove(HttpChunkAggregator.class);
        }

        p.replace(HttpRequestDecoder.class, "wsdecoder", new WebSocket13FrameDecoder(true, allowExtensions));
        p.replace(HttpResponseEncoder.class, "wsencoder", new WebSocket13FrameEncoder(false));

        return future;
    }
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.