Ejemplo n.º 1
0
        private void SyncAddFirst(IChannelHandler handler)
        {
            DefaultChannelHandlerContext newContext  = new DefaultChannelHandlerContext(_channel, handler);
            ChannleHandlerContext        nextContext = this._head.Next;

            newContext.Next  = nextContext;
            newContext.Prev  = this._head;
            this._head.Next  = newContext;
            nextContext.Prev = newContext;

            newContext.Handler.HandlerInstalled(newContext);
        }
Ejemplo n.º 2
0
        private void SyncAddLast(IChannelHandler handler)
        {
            DefaultChannelHandlerContext newContext  = new DefaultChannelHandlerContext(_channel, handler);
            ChannleHandlerContext        prevContext = this._tail.Prev;

            newContext.Prev  = prevContext;
            newContext.Next  = this._tail;
            this._tail.Prev  = newContext;
            prevContext.Next = newContext;

            newContext.Handler.HandlerInstalled(newContext);
        }