public override void Call()
 {
     AutoCSer.Net.TcpInternalSimpleServer.ServerSocket socket = Socket;
     AutoCSer.Net.TcpServer.ReturnValue <_p2>          value  = new AutoCSer.Net.TcpServer.ReturnValue <_p2>();
     get(ref value);
     push(this);
     socket.SendAsync(_c5, ref value);
 }
            /// <summary>
            /// 命令处理
            /// </summary>
            /// <param name="index">命令序号</param>
            /// <param name="socket">TCP 内部服务套接字数据发送</param>
            /// <param name="data">命令数据</param>
            /// <returns>是否成功</returns>
            public override bool DoCommand(int index, AutoCSer.Net.TcpInternalSimpleServer.ServerSocket socket, ref SubArray <byte> data)
            {
                AutoCSer.Net.TcpServer.ReturnType returnType;
                switch (index - 128)
                {
                case 0:
                    returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown;
                    try
                    {
                        _p1 inputParameter = new _p1();
                        if (socket.DeSerialize(ref data, ref inputParameter, true))
                        {
                            _p2 outputParameter = new _p2();

                            Value.addAsynchronous(inputParameter.p0, inputParameter.p1, socket.GetCallback <_p2, int>(_c0, ref outputParameter));
                            return(true);
                        }
                        returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError;
                    }
                    catch (Exception error)
                    {
                        returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException;
                        socket.Log(error);
                    }
                    return(socket.SendOutput(returnType));

                case 1:
                    returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown;
                    try
                    {
                        _p1 inputParameter = new _p1();
                        if (socket.DeSerialize(ref data, ref inputParameter, true))
                        {
                            _p2 _outputParameter_ = new _p2();

                            int Return;

                            Return = Value.addSynchronous(inputParameter.p0, inputParameter.p1);
                            _outputParameter_.Return = Return;
                            return(socket.Send(_c1, ref _outputParameter_));
                        }
                        returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError;
                    }
                    catch (Exception error)
                    {
                        returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException;
                        socket.Log(error);
                    }
                    return(socket.SendOutput(returnType));

                default: return(false);
                }
            }
 public override void Call()
 {
     AutoCSer.Net.TcpInternalSimpleServer.ServerSocket socket = Socket;
     AutoCSer.Net.TcpServer.ReturnValue /*IF:OutputParameterIndex*/ <@OutputParameterTypeName> /*IF:OutputParameterIndex*/ value = new AutoCSer.Net.TcpServer.ReturnValue/*IF:OutputParameterIndex*/ <@OutputParameterTypeName> /*IF:OutputParameterIndex*/ ();
     get(ref value);
     push(this);
     #region IF OutputParameterIndex
     socket.SendAsync(@StaticMethodIdentityCommand, ref value);
     #endregion IF OutputParameterIndex
     #region NOT OutputParameterIndex
     socket.SendAsync(value.Type);
     #endregion NOT OutputParameterIndex
 }
                public static /*PUSH:Method*/ @MethodReturnType.FullName /*PUSH:Method*/ @StaticMethodIndexName(/*IF:ClientParameterName*/ AutoCSer.Net.TcpInternalSimpleServer.ServerSocket _socket_ /*IF:InputParameters.Length*/, /*IF:InputParameters.Length*//*IF:ClientParameterName*//*LOOP:InputParameters*//*PUSH:MethodParameter*/ @ParameterTypeRefName @ParameterJoinName /*PUSH:MethodParameter*//*LOOP:InputParameters*/)
                {
                    #region IF MemberIndex
                    #region NOT Method.IsGetMember
                    @Type.FullName /**/.@StaticPropertyName = /*LOOP:Method.Parameters*/ @ParameterName /*LOOP:Method.Parameters*/;
                    #endregion NOT Method.IsGetMember
                    #region IF Method.IsGetMember
                    return /*NOTE*/ ((FullName)/*NOTE*/ @Type.FullName /**/.@StaticPropertyName);

                    #endregion IF Method.IsGetMember
                    #endregion IF MemberIndex

                    #region NOT MemberIndex
                    /*IF:MethodIsReturn*/
                    return /*NOTE*/ ((FullName)/*NOTE*//*IF:MethodIsReturn*/ @Type.FullName /*PUSH:Method*/.@StaticMethodName(/*IF:ClientParameterName*/ _socket_ /*IF:InputParameters.Length*/, /*IF:InputParameters.Length*//*IF:ClientParameterName*//*LOOP:InputParameters*//*PUSH:MethodParameter*/ @ParameterJoinRefName /*PUSH:MethodParameter*//*LOOP:InputParameters*/));/*PUSH:Method*/

                    #endregion NOT MemberIndex
                }
 public static void @StaticMethodIndexName(/*IF:ClientParameterName*/ AutoCSer.Net.TcpInternalSimpleServer.ServerSocket _socket_, /*IF:ClientParameterName*//*LOOP:InputParameters*//*PUSH:MethodParameter*/ @ParameterTypeRefName @ParameterName, /*PUSH:MethodParameter*//*LOOP:InputParameters*/ Func <AutoCSer.Net.TcpServer.ReturnValue </*PUSH:Method*/ @MethodReturnType.FullName /*PUSH:Method*/>, bool> _onReturn_)
 {
     @Type.FullName /*PUSH:Method*/.@StaticMethodName(/*IF:ClientParameterName*/ _socket_, /*IF:ClientParameterName*//*LOOP:InputParameters*//*PUSH:MethodParameter*/ @ParameterRefName, /*PUSH:MethodParameter*//*LOOP:InputParameters*/ _onReturn_);/*PUSH:Method*/
 }
            /// <summary>
            /// 命令处理
            /// </summary>
            /// <param name="index">命令序号</param>
            /// <param name="socket">TCP 内部服务套接字数据发送</param>
            /// <param name="data">命令数据</param>
            /// <returns>是否成功</returns>
            public override bool DoCommand(int index, AutoCSer.Net.TcpInternalSimpleServer.ServerSocket socket, ref SubArray <byte> data)
            {
                AutoCSer.Net.TcpServer.ReturnType returnType;
                switch (index - @CommandStartIndex)
                {
                    #region LOOP MethodIndexs
                    #region NOT IsNullMethod
                case @MethodIndex:
                    #region IF Attribute.IsExpired
                    #region IF OutputParameterIndex
                    return(socket.SendOutput(AutoCSer.Net.TcpServer.ReturnType.VersionExpired));

                    #endregion IF OutputParameterIndex
                    #region NOT OutputParameterIndex
                    return(socket.Send(AutoCSer.Net.TcpServer.ReturnType.VersionExpired));

                    #endregion NOT OutputParameterIndex
                    #endregion IF Attribute.IsExpired
                    #region NOT Attribute.IsExpired
                    returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown;
                    try
                    {
                        #region IF InputParameterIndex
                        @InputParameterTypeName inputParameter = new @InputParameterTypeName();
                        if (socket.DeSerialize(ref data, ref inputParameter /*IF:IsSimpleSerializeInputParamter*/, true /*IF:IsSimpleSerializeInputParamter*/))
                        #endregion IF InputParameterIndex
                        {
                            #region IF IsAsynchronousCallback
                            #region IF MethodIsReturn
                            @OutputParameterTypeName outputParameter = new @OutputParameterTypeName();
                            @MethodType.FullName /**/.TcpStaticSimpleServer.@StaticMethodIndexName(/*IF:ClientParameterName*/ socket, /*IF:ClientParameterName*//*LOOP:InputParameters*//*AT:ParameterRef*//*PUSH:Parameter*/ inputParameter.@ParameterName, /*PUSH:Parameter*//*LOOP:InputParameters*//*NOTE*/ (Func <AutoCSer.Net.TcpServer.ReturnValue <MethodReturnType.FullName>, bool>)(object)(Func <AutoCSer.Net.TcpServer.ReturnValue <@MethodReturnType.FullName>, bool>) /*NOTE*/ socket.GetCallback <@OutputParameterTypeName /*NOT:IsVerifyMethod*/, @MethodReturnType.FullName /*NOT:IsVerifyMethod*/>(@StaticMethodIdentityCommand, ref outputParameter));
                            #endregion IF MethodIsReturn
                            #region NOT MethodIsReturn
                            @MethodType.FullName /**/.TcpStaticSimpleServer.@StaticMethodIndexName(/*IF:ClientParameterName*/ socket, /*IF:ClientParameterName*//*LOOP:InputParameters*//*AT:ParameterRef*//*PUSH:Parameter*/ inputParameter.@ParameterName, /*PUSH:Parameter*//*LOOP:InputParameters*//*NOTE*/ (Func <AutoCSer.Net.TcpServer.ReturnValue <MethodReturnType.FullName>, bool>)(object)(Func <AutoCSer.Net.TcpServer.ReturnValue, bool>) /*NOTE*/ socket.GetCallback());
                            #endregion NOT MethodIsReturn
                            return(true);

                            #endregion IF IsAsynchronousCallback
                            #region NOT IsAsynchronousCallback
                            #region IF IsMethodServerCall
                            (@MethodStreamName /**/.Pop() ?? new @MethodStreamName()).Set(socket, @ServerTask /*IF:InputParameterIndex*/, ref inputParameter /*IF:InputParameterIndex*/);
                            return(true);

                            #endregion IF IsMethodServerCall
                            #region NOT IsMethodServerCall
                            #region IF OutputParameterIndex
                            @OutputParameterTypeName _outputParameter_ = new @OutputParameterTypeName();
                            #endregion IF OutputParameterIndex
                            /*IF:MethodIsReturn*/
                            @MethodReturnType.FullName @ReturnName;    /*IF:MethodIsReturn*/
                            #region IF MemberIndex
                            #region IF Method.IsGetMember
                            @ReturnName = /*NOTE*/ (MethodReturnType.FullName) /*NOTE*/ @MethodType.FullName /**/.TcpStaticSimpleServer.@StaticMethodIndexName();
                            #endregion IF Method.IsGetMember
                            #region NOT Method.IsGetMember
                            @MethodType.FullName /**/.TcpStaticSimpleServer.@StaticMethodIndexName(/*LOOP:InputParameters*/ inputParameter./*PUSH:Parameter*/ @ParameterName /*PUSH:Parameter*//*LOOP:InputParameters*/);
                            #endregion NOT Method.IsGetMember
                            #endregion IF MemberIndex
                            #region NOT MemberIndex
                            /*IF:MethodIsReturn*/
                            @ReturnName = /*NOTE*/ (MethodReturnType.FullName) /*NOTE*//*IF:MethodIsReturn*//*PUSH:Method*/ @MethodType.FullName /**/.TcpStaticSimpleServer.@StaticMethodIndexName/*PUSH:Method*/ (/*IF:ClientParameterName*/ socket /*IF:InputParameters.Length*/, /*IF:InputParameters.Length*//*IF:ClientParameterName*//*LOOP:InputParameters*//*AT:ParameterRef*//*IF:MethodParameter.IsOut*//*PUSH:InputParameter*/ _outputParameter_.@ParameterName /*PUSH:InputParameter*//*IF:MethodParameter.IsOut*//*NOTE*/, /*NOTE*//*NOT:MethodParameter.IsOut*//*PUSH:Parameter*/ inputParameter.@ParameterName /*PUSH:Parameter*//*NOT:MethodParameter.IsOut*//*PUSH:Parameter*//*AT:ParameterJoin*//*PUSH:Parameter*//*LOOP:InputParameters*/);
                            #endregion NOT MemberIndex
                            #region IF OutputParameterIndex
                            #region IF IsVerifyMethod
                            if (/*NOTE*/ (bool)(object)/*NOTE*/ @ReturnName)
                            {
                                socket.SetVerifyMethod();
                            }
                            #endregion IF IsVerifyMethod
                            #region LOOP OutputParameters
                            #region NOT InputMethodParameter.IsOut
                            /*PUSH:Parameter*/
                            _outputParameter_.@ParameterName /*PUSH:Parameter*/ = inputParameter./*PUSH:InputParameter*/ @ParameterName /*PUSH:InputParameter*/;
                            #endregion NOT InputMethodParameter.IsOut
                            #endregion LOOP OutputParameters
                            #region IF MethodIsReturn
                            _outputParameter_.@ReturnName = @ReturnName;
                            #endregion IF MethodIsReturn
                            return(socket.Send(@StaticMethodIdentityCommand, ref _outputParameter_));

                            #endregion IF OutputParameterIndex
                            #region NOT OutputParameterIndex
                            return(socket.Send());

                            #endregion NOT OutputParameterIndex
                            #endregion NOT IsMethodServerCall
                            #endregion NOT IsAsynchronousCallback
                        }
                        #region IF InputParameterIndex
                        returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError;
                        #endregion IF InputParameterIndex
                    }
                    catch (Exception error)
                    {
                        returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException;
                        socket.Log(error);
                    }
                    #region IF OutputParameterIndex
                    return(socket.SendOutput(returnType));

                    #endregion IF OutputParameterIndex
                    #region NOT OutputParameterIndex
                    return(socket.Send(returnType));

                    #endregion NOT OutputParameterIndex
                    #endregion NOT Attribute.IsExpired
                    #endregion NOT IsNullMethod
                    #endregion LOOP MethodIndexs
                default: return(false);
                }
            }
示例#7
0
 private string myName(AutoCSer.Net.TcpInternalSimpleServer.ServerSocket client)
 {
     return(TcpStaticSimpleServer.GetSession.MyName(client));
 }
示例#8
0
 private bool login(AutoCSer.Net.TcpInternalSimpleServer.ServerSocket client, string user, string password)
 {
     return(TcpStaticSimpleServer.Session.Login(client, user, password));
 }
示例#9
0
 private static string myName(AutoCSer.Net.TcpInternalSimpleServer.ServerSocket client)
 {
     return(MyName(client));
 }