private void EnableSsl(ChannelHandlerContext ctx)
        {
            ChannelPipeline p = ctx.pipeline();

            p.addLast(_sslCtx.newHandler(ctx.alloc()));
            p.addLast(new TransportSelectionHandler(_boltChannel, null, _encryptionRequired, true, _logging, _boltProtocolFactory));
            p.remove(this);
        }
Esempio n. 2
0
            protected internal override void InitChannel(SocketChannel channel)
            {
                ChannelPipeline pipeline = channel.pipeline();

                ChannelHandler clientOnConnectSslHandler = SslPolicy.nettyClientHandler(channel, SslContext);

                pipeline.addLast(clientOnConnectSslHandler);
                pipeline.addLast(new ChannelInboundHandlerAdapterAnonymousInnerClass(this));
                pipeline.addLast(Bucket);
            }
Esempio n. 3
0
            protected internal override void InitChannel(SocketChannel channel)
            {
                ChannelPipeline pipeline = channel.pipeline();

                pipeline.addLast("frameEncoder", new LengthFieldPrepender(4));
                pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(int.MaxValue, 0, 4, 0, 4));
                pipeline.addLast("requestMessageEncoder", new ClientMessageEncoder());
                pipeline.addLast("responseMessageDecoder", new ClientMessageDecoder());
                pipeline.addLast(new NettyHandshakeClient(HandshakeClient));
            }
Esempio n. 4
0
                protected internal override void initChannel(SocketChannel ch)
                {
                    ChannelPipeline pipeline = ch.pipeline();

                    _outerInstance.handshakeServer = new HandshakeServer(_applicationProtocolRepository, _modifierProtocolRepository, new SimpleNettyChannel(ch, NullLog.Instance));
                    pipeline.addLast("frameEncoder", new LengthFieldPrepender(4));
                    pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(int.MaxValue, 0, 4, 0, 4));
                    pipeline.addLast("responseMessageEncoder", new ServerMessageEncoder());
                    pipeline.addLast("requestMessageDecoder", new ServerMessageDecoder());
                    pipeline.addLast(new NettyHandshakeServer(_outerInstance.handshakeServer));
                }
Esempio n. 5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: protected void initChannel(io.netty.channel.socket.SocketChannel ch) throws Exception
            protected internal override void initChannel(SocketChannel ch)
            {
                ChannelPipeline pipeline = ch.pipeline();

                SSLEngine sslEngine = _outerInstance.sslContext.newEngine(ch.alloc());

                sslEngine.NeedClientAuth = true;
                SslHandler sslHandler = new SslHandler(sslEngine);

                pipeline.addLast(sslHandler);

                pipeline.addLast(new Responder());
            }
        private void SwitchToWebsocket(ChannelHandlerContext ctx)
        {
            ChannelPipeline p = ctx.pipeline();

            p.addLast(new HttpServerCodec(), new HttpObjectAggregator(MAX_WEBSOCKET_HANDSHAKE_SIZE), new WebSocketServerProtocolHandler("/", null, false, MAX_WEBSOCKET_FRAME_SIZE), new WebSocketFrameAggregator(MAX_WEBSOCKET_FRAME_SIZE), new WebSocketFrameTranslator(), NewHandshaker());
            p.remove(this);
        }
        private void SwitchToSocket(ChannelHandlerContext ctx)
        {
            ChannelPipeline p = ctx.pipeline();

            p.addLast(NewHandshaker());
            p.remove(this);
        }
Esempio n. 8
0
        protected override void init(Channel _channel)
        {
            ChannelPipeline p = _channel.pipeline();

            EventLoopGroup currentChildGroup   = childGroup;
            ChannelHandler currentChildHandler = _childHandler;

            p.addLast(new ChannelInitializer <Channel>(channel =>
            {
                ChannelPipeline pipeline = channel.pipeline();
                ChannelHandler _handler  = handler();
                if (_handler != null)
                {
                    pipeline.addLast(_handler);
                }

                channel.eventLoop().execute(() => pipeline.addLast(new ServerBootstrapAcceptor(channel, currentChildGroup, currentChildHandler)));
            }));
        }
Esempio n. 9
0
 public static void AddLengthFieldPipes(ChannelPipeline pipeline, int frameLength)
 {
     pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(frameLength + 4, 0, 4, 0, 4));
     pipeline.addLast("frameEncoder", new LengthFieldPrepender(4));
 }
Esempio n. 10
0
        protected override void init(Channel _channel)
        {
            ChannelPipeline p = _channel.pipeline();

            p.addLast(handler());
        }