예제 #1
0
        public override void ChannelRead(IFABChannelHandlerContext ctx, object msg)
        {
            bool flag = true;

            try
            {
                if (this.AcceptInboundMessage(msg))
                {
                    I local = (I)msg;
                    this.ChannelRead0(ctx, local);
                }
                else
                {
                    flag = false;
                    ctx.FireChannelRead(msg);
                }
            }
            finally
            {
                if (this.autoRelease & flag)
                {
                    ReferenceCountUtil.Release(msg);
                }
            }
        }
예제 #2
0
 public override void Flush(IFABChannelHandlerContext context)
 {
     context.Flush();
     if (this.context == null)
     {
         this.context = (FABHandlerContext)context;
     }
 }
예제 #3
0
 public override void ChannelActive(IFABChannelHandlerContext context)
 {
     if (this.context == null)
     {
         this.context = (FABHandlerContext)context;
     }
     base.ChannelActive(context);
 }
예제 #4
0
            public void ChannelUnregistered(IFABChannelHandlerContext context)
            {
                context.FireChannelUnregistered();

                // Remove all handlers sequentially if channel is closed and unregistered.
                if (!this.pipeline.channel.Open)
                {
                    this.pipeline.Destroy();
                }
            }
예제 #5
0
 protected override void ChannelRead0(IFABChannelHandlerContext ctx, FABMessage msg)
 {
     try
     {
         var item = Factory.GetStructure(msg);
     }
     finally
     {
         ctx.FireChannelReadComplete();
     }
 }
예제 #6
0
            public void ChannelRegistered(IFABChannelHandlerContext context)
            {
                if (this.firstRegistration)
                {
                    this.firstRegistration = false;
                    // We are now registered to the EventLoop. It's time to call the callbacks for the ChannelHandlers,
                    // that were added before the registration was done.
                    this.pipeline.CallHandlerAddedForAllHandlers();
                }

                context.FireChannelRegistered();
            }
예제 #7
0
        public override Task WriteAsync(IFABChannelHandlerContext ctx, object msg)
        {
            bool flag   = true;
            Task towork = null;

            try
            {
                if (this.AcceptInboundMessage(msg))
                {
                    I local = (I)msg;
                    towork = this.WriteAsync0(ctx, local);
                }
            }
            finally
            {
                if (this.autoRelease & flag)
                {
                    ReferenceCountUtil.Release(msg);
                }
            }
            return(towork);
        }
예제 #8
0
 public void ChannelWritabilityChanged(IFABChannelHandlerContext context)
 {
     context.FireChannelWritabilityChanged();
 }
예제 #9
0
 public void UserEventTriggered(IFABChannelHandlerContext context, object evt)
 {
     this.FireUserEventTriggered(evt);
 }
예제 #10
0
            public void ChannelReadComplete(IFABChannelHandlerContext ctx)
            {
                ctx.FireChannelReadComplete();

                this.ReadIfIsAutoRead();
            }
예제 #11
0
 public void ChannelRead(IFABChannelHandlerContext ctx, object msg)
 {
     ctx.FireChannelRead(msg);
 }
예제 #12
0
 public Task CloseAsync(IFABChannelHandlerContext context)
 {
     return(this.channelUnsafe.CloseAsync());
 }
예제 #13
0
 public override Task BindAsync(IFABChannelHandlerContext ctx, EndPoint localAddress)
 {
     return(ctx.BindAsync(localAddress));
 }
예제 #14
0
 public void ExceptionCaught(IFABChannelHandlerContext ctx, Exception exception)
 {
     ctx.FireExceptionCaught(exception);
 }
예제 #15
0
 public void HandlerRemoved(IFABChannelHandlerContext context)
 {
 }
예제 #16
0
 public void HandlerAdded(IFABChannelHandlerContext context)
 {
 }
예제 #17
0
 public Task WriteAsync(IFABChannelHandlerContext context, object message)
 {
     return(this.channelUnsafe.WriteAsync(message));
 }
예제 #18
0
 public void Read(IFABChannelHandlerContext context)
 {
     this.channelUnsafe.BeginRead();
 }
예제 #19
0
 public Task DeregisterAsync(IFABChannelHandlerContext context)
 {
     return(this.channelUnsafe.DeregisterAsync());
 }
예제 #20
0
 public Task BindAsync(IFABChannelHandlerContext context, EndPoint localAddress)
 {
     return(this.channelUnsafe.BindAsync(localAddress));
 }
예제 #21
0
 public override void ChannelReadComplete(IFABChannelHandlerContext context)
 {
     context.Flush();
 }
예제 #22
0
 public Task ConnectAsync(IFABChannelHandlerContext context, EndPoint remoteAddress, EndPoint localAddress)
 {
     return(this.channelUnsafe.ConnectAsync(remoteAddress, localAddress));
 }
예제 #23
0
 protected override Task WriteAsync0(IFABChannelHandlerContext ctx, FABMessage msg)
 {
     return(ctx.WriteAsync(msg));
 }
예제 #24
0
 public void Flush(IFABChannelHandlerContext context)
 {
     this.channelUnsafe.Flush();
 }
예제 #25
0
            public void ChannelActive(IFABChannelHandlerContext context)
            {
                context.FireChannelActive();

                this.ReadIfIsAutoRead();
            }
예제 #26
0
 public Task DisconnectAsync(IFABChannelHandlerContext context)
 {
     return(this.channelUnsafe.DisconnectAsync());
 }
예제 #27
0
 protected abstract void ChannelRead0(IFABChannelHandlerContext ctx, I msg);
예제 #28
0
 public void ChannelInactive(IFABChannelHandlerContext context)
 {
     context.FireChannelInactive();
 }
예제 #29
0
 protected abstract Task WriteAsync0(IFABChannelHandlerContext ctx, I msg);
예제 #30
0
 public void Flush(IFABChannelHandlerContext context)
 {
     context.Flush();
 }