Esempio 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);
                }
            }
        }
    }
Esempio n. 2
0
    private void ReceiveCallback(IAsyncResult iasyncResult_0)
    {
        NetworkStream asyncState = (NetworkStream)iasyncResult_0.AsyncState;

        try
        {
            int num = asyncState.EndRead(iasyncResult_0);
            if (num == 0)
            {
                base.method_0(asyncState, true);
            }
            else
            {
                this.class5_0.method_7(num);
                for (string str = this.class5_0.kjfPdghQbi(); str != null; str = this.class5_0.kjfPdghQbi())
                {
                    IHeader4           interface2 = null;
                    MessageInvalidType valid      = MessageInvalidType.Valid;
                    if (!this.object_5.imethod_12(str))
                    {
                        valid = MessageInvalidType.InvalidToken;
                    }
                    else
                    {
                        interface2 = this.object_5.imethod_11(str);
                        if (interface2 == null)
                        {
                            valid = MessageInvalidType.InvalidHeader;
                        }
                    }
                    if (valid != MessageInvalidType.Valid)
                    {
                        goto Label_00DF;
                    }
                    IMessageHandler interface3 = new Message1(interface2, str, base.ipendPoint_0);
                    base.AsynHandleMessage(interface3);
                }
                asyncState.BeginRead(this.class5_0.method_4(), this.class5_0.method_5(), this.class5_0.method_6(), new AsyncCallback(this.ReceiveCallback), asyncState);
            }
            return;

Label_00DF:
            base.OnInvalidMessageReceived(base.ipendPoint_0, MessageInvalidType.InvalidHeader);
            asyncState.Close();
            base.method_0(asyncState, false);
        }
        catch (Exception exception)
        {
            if ((exception is IOException) || (exception is ObjectDisposedException))
            {
                base.method_0(asyncState, true);
            }
            else if (!base.imethod_16())
            {
                base.emptyAgileLogger_0.Log(exception, "CJFramework.Engine.Tcp.Passive.PassiveTextTcpEngine.ReceiveCallback", ErrorLevel.High);
            }
        }
    }
Esempio n. 3
0
    public Class29 imethod_0(IPEndPoint ipendPoint_0, byte[] byte_0)
    {
        if (byte_0 == null)
        {
            return(null);
        }
        if (byte_0.Length > this.int_0)
        {
            return(new Class29(ipendPoint_0, MessageInvalidType.MessageSizeOverflow));
        }
        string str = this.object_0.imethod_8(byte_0, 0, byte_0.Length);

        if (!this.object_0.imethod_12(str))
        {
            return(new Class29(ipendPoint_0, MessageInvalidType.InvalidToken));
        }
        IHeader4 interface2 = this.object_0.imethod_11(str);

        if (interface2 == null)
        {
            return(new Class29(ipendPoint_0, MessageInvalidType.InvalidHeader));
        }
        return(new Class29(ipendPoint_0, new Message1(interface2, str, ipendPoint_0)));
    }
Esempio n. 4
0
 public Message1(IHeader4 interface27_0, string string_1, IPEndPoint ipendPoint_1)
 {
     this.object_0     = interface27_0;
     this.string_0     = string_1;
     this.ipendPoint_0 = ipendPoint_1;
 }