Exemplo n.º 1
0
    protected override void ServeOverLap(IAsyncResult iasyncResult_0)
    {
        Class5 asyncState = (Class5)iasyncResult_0.AsyncState;

        if (!asyncState.imethod_6())
        {
            try
            {
                int num = asyncState.GetStream().EndRead(iasyncResult_0);
                if (num <= 0)
                {
                    base.OnSomeOneDisconnected(asyncState, DisconnectedType.NetworkInterrupted);
                }
                else
                {
                    asyncState.method_7(num);
                    for (string str = asyncState.kjfPdghQbi(); str != null; str = asyncState.kjfPdghQbi())
                    {
                        IHeader4 interface2 = this.object_0.imethod_11(str);
                        if (interface2 == null)
                        {
                            goto Label_011D;
                        }
                        Message1 class3 = new Message1(interface2, str, asyncState.GetIPEndPoint());
                        base.OnMessageReceived(asyncState, class3);
                    }
                    if (!base.bool_0 && !asyncState.imethod_6())
                    {
                        if (asyncState.method_9())
                        {
                            base.OnSomeOneDisconnected(asyncState, DisconnectedType.InvalidMessage);
                            base.emptyAgileLogger_0.Log("ErrorMessage", string.Format("Source Address:{0} ,MessageInvalidType:{1}", asyncState.GetIPEndPoint(), MessageInvalidType.MessageSizeOverflow), "CJFramework.Engine.Tcp.Server.TextTcpEngine.ServeOverLap", ErrorLevel.Standard);
                            base.OnInvalidMessageReceived(asyncState.GetIPEndPoint(), MessageInvalidType.MessageSizeOverflow);
                        }
                        else
                        {
                            asyncState.GetStream().BeginRead(asyncState.method_4(), asyncState.method_5(), asyncState.method_6(), new AsyncCallback(this.ServeOverLap), asyncState);
                        }
                    }
                }
                return;

Label_011D:
                base.OnSomeOneDisconnected(asyncState, DisconnectedType.InvalidMessage);
                base.emptyAgileLogger_0.Log("ErrorMessage", string.Format("Source Address:{0} ,MessageInvalidType:{1}", asyncState.GetIPEndPoint(), MessageInvalidType.InvalidHeader), "CJFramework.Engine.Tcp.Server.TextTcpEngine.ServeOverLap", ErrorLevel.Standard);
                base.OnInvalidMessageReceived(asyncState.GetIPEndPoint(), MessageInvalidType.InvalidHeader);
            }
            catch (Exception exception)
            {
                if ((exception is IOException) || (exception is ObjectDisposedException))
                {
                    base.OnSomeOneDisconnected(asyncState, DisconnectedType.NetworkInterrupted);
                }
                else
                {
                    base.emptyAgileLogger_0.Log(exception, "CJFramework.Engine.Tcp.Server.TextTcpEngine.ServeOverLap", ErrorLevel.High);
                }
            }
        }
    }