コード例 #1
0
        protected override void ChannelRead0(ChannelHandlerContext ctx, HttpRequest req)
        {
            uri = req.GetUri();
            IO.Netty.Channel.Channel     client        = ctx.Channel();
            IO.Netty.Bootstrap.Bootstrap proxiedServer = new IO.Netty.Bootstrap.Bootstrap().Group
                                                             (client.EventLoop()).Channel(typeof(NioSocketChannel)).Handler(new _ChannelInitializer_106
                                                                                                                                (this, client));
            ChannelFuture f = proxiedServer.Connect(host);

            proxiedChannel = f.Channel();
            f.AddListener(new _ChannelFutureListener_115(this, ctx, req, client));
        }
コード例 #2
0
 /// <exception cref="System.Exception"/>
 public override void ChannelActive(ChannelHandlerContext ctx)
 {
     activeChannels.AddItem(ctx.Channel());
 }
コード例 #3
0
 public override void ExceptionCaught(ChannelHandlerContext ctx, Exception cause)
 {
     Log.Debug("Proxy for " + uri + " failed. cause: ", cause);
     CloseOnFlush(ctx.Channel());
 }