예제 #1
0
            void Accept(Tcp tcp)
            {
                var ch = (TcpServerChannel)this.channel;
                IChannelPipeline            pipeline    = ch.Pipeline;
                IRecvByteBufAllocatorHandle allocHandle = this.RecvBufAllocHandle;

                bool      closed    = false;
                Exception exception = null;

                try
                {
                    var tcpChannel = new TcpChannel(ch, tcp);
                    ch.Pipeline.FireChannelRead(tcpChannel);
                    allocHandle.IncMessagesRead(1);
                }
                catch (ObjectDisposedException)
                {
                    closed = true;
                }
                catch (Exception ex)
                {
                    exception = ex;
                }

                allocHandle.ReadComplete();
                pipeline.FireChannelReadComplete();

                if (exception != null)
                {
                    pipeline.FireExceptionCaught(exception);
                }

                if (closed && ch.Open)
                {
                    this.CloseSafe();
                }
            }
예제 #2
0
 public TcpChannelUnsafe(TcpChannel channel) : base(channel)
 {
 }
예제 #3
0
 public TcpChannelConfig(TcpChannel channel) : base(channel)
 {
 }