Exemplo n.º 1
0
        public void FireNextRead(object msg)
        {
            IEventLoop loop = _channel.Loop;

            if (loop.InCurrentThread())
            {
                if (Next != null)
                {
                    Next.Handler.ChannelRead(Next, msg);
                }
            }
            else
            {
                loop.Execute(new SimpleRunnable(() =>
                {
                    if (Next != null)
                    {
                        Next.Handler.ChannelRead(Next, msg);
                    }
                }));
            }
        }
Exemplo n.º 2
0
        public void FireNextAccept(object accepter)
        {
            IEventLoop loop = _channel.Loop;

            if (loop.InCurrentThread())
            {
                if (Next != null)
                {
                    Next.Handler.ChannelAccept(Next, accepter);
                }
            }
            else
            {
                loop.Execute(new SimpleRunnable(() =>
                {
                    if (Next != null)
                    {
                        Next.Handler.ChannelAccept(Next, accepter);
                    }
                }));
            }
        }
Exemplo n.º 3
0
        public void FireNextInactive()
        {
            IEventLoop loop = _channel.Loop;

            if (loop.InCurrentThread())
            {
                if (Next != null)
                {
                    Next.Handler.ChannelInactive(Next);
                }
            }
            else
            {
                loop.Execute(new SimpleRunnable(() =>
                {
                    if (Next != null)
                    {
                        Next.Handler.ChannelInactive(Next);
                    }
                }));
            }
        }
Exemplo n.º 4
0
        public void FirePreWrite(object msg)
        {
            IEventLoop loop = _channel.Loop;

            if (loop.InCurrentThread())
            {
                if (Prev != null)
                {
                    Prev.Handler.ChannelWrite(Prev, msg);
                }
            }
            else
            {
                loop.Execute(new SimpleRunnable(() =>
                {
                    if (Prev != null)
                    {
                        Prev.Handler.ChannelWrite(Prev, msg);
                    }
                }));
            }
        }