Ejemplo n.º 1
0
        private void SwitchToSocket(ChannelHandlerContext ctx)
        {
            ChannelPipeline p = ctx.pipeline();

            p.addLast(NewHandshaker());
            p.remove(this);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
        private void remove(ChannelHandlerContext ctx)
        {
            try
            {
                ChannelPipeline pipeline = ctx.pipeline();

                if (pipeline.context(this) != null)
                {
                    pipeline.remove(this);
                }
            }
            finally
            {
                bool ret;
                initMap.TryRemove(ctx, out ret);
            }
        }