Пример #1
0
    protected override void ServeOverLap(IAsyncResult iasyncResult_0)
    {
        Class6 asyncState = (Class6)iasyncResult_0.AsyncState;

        if (!asyncState.imethod_6())
        {
            try
            {
                int num = asyncState.GetStream().EndRead(iasyncResult_0);
                if (num <= 0)
                {
                    base.OnSomeOneDisconnected(asyncState, DisconnectedType.NetworkInterrupted);
                }
                else
                {
                    if (!(((this.object_0 == null) || this.heHhGnOsoo) || asyncState.imethod_1()) && (asyncState.method_7()[0] != Class41.byte_0))
                    {
                        string str = asyncState.GetIPEndPoint().Address.ToString();
                        if (!this.class38_0.method_1(str))
                        {
                            this.class38_0.method_0(str);
                            base.OnSomeOneDisconnected(asyncState, DisconnectedType.InvalidMessage);
                            return;
                        }
                    }
                    asyncState.method_10(num);
                    base.method_2(asyncState, asyncState.method_7());
                    for (MessageHandler class3 = asyncState.method_11(); class3 != null; class3 = asyncState.method_11())
                    {
                        if (base.imethod_27())
                        {
                            asyncState.imethod_10().method_2();
                            asyncState.imethod_10().method_4(class3);
                        }
                        else
                        {
                            base.OnMessageReceived(asyncState, class3);
                        }
                    }
                    if (asyncState.method_6())
                    {
                        base.OnSomeOneDisconnected(asyncState, DisconnectedType.NetworkInterrupted);
                    }
                    else if (!base.bool_0 && !asyncState.imethod_6())
                    {
                        if (asyncState.method_13())
                        {
                            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.WebSocketEngine.ServeOverLap", ErrorLevel.Standard);
                            base.OnInvalidMessageReceived(asyncState.GetIPEndPoint(), MessageInvalidType.MessageSizeOverflow);
                        }
                        else
                        {
                            asyncState.GetStream().BeginRead(asyncState.method_7(), asyncState.method_8(), asyncState.method_9(), new AsyncCallback(this.ServeOverLap), asyncState);
                        }
                    }
                }
            }
            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.WebSocketEngine.ServeOverLap", ErrorLevel.High);
                }
            }
        }
    }