Beispiel #1
0
 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(@MethodIdentityCommand, ref value);
     #endregion IF OutputParameterIndex
     #region NOT OutputParameterIndex
     socket.SendAsync(value.Type);
     #endregion NOT OutputParameterIndex
 }
Beispiel #2
0
                /// <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();
                                /*PUSH:Method*/
                                Value.@MethodName/*PUSH:Method*/ (/*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*/>(@MethodIdentityCommand, ref outputParameter));
                                #endregion IF MethodIsReturn
                                #region NOT MethodIsReturn
                                /*PUSH:Method*/
                                Value.@MethodName/*PUSH:Method*/ (/*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, Value, @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
                                #region IF Method.PropertyParameter
                                @ReturnName = /*NOTE*/ (MethodReturnType.FullName) /*NOTE*/ Value[/*IF:ClientParameterName*/ socket /*IF:InputParameters.Length*/, /*IF:InputParameters.Length*//*IF:ClientParameterName*//*LOOP:InputParameters*//*AT:ParameterRef*//*PUSH:Parameter*/ inputParameter.@ParameterName /*AT:ParameterJoin*//*PUSH:Parameter*//*LOOP:InputParameters*/];
                                #endregion IF Method.PropertyParameter
                                #region NOT Method.PropertyParameter
                                @ReturnName = /*NOTE*/ (MethodReturnType.FullName) /*NOTE*/ Value.@PropertyName;
                                #endregion NOT Method.PropertyParameter
                                #endregion IF Method.IsGetMember
                                #region NOT Method.IsGetMember
                                #region IF Method.PropertyParameter
                                Value[/*IF:ClientParameterName*/ socket, /*IF:ClientParameterName*//*LOOP:InputParameters*//*NOT:MethodParameter.IsPropertyValue*//*AT:ParameterRef*//*PUSH:Parameter*/ inputParameter.@ParameterName /*AT:ParameterJoin*//*PUSH:Parameter*//*NOT:MethodParameter.IsPropertyValue*//*LOOP:InputParameters*/] = /*LOOP:InputParameters*//*IF:MethodParameter.IsPropertyValue*//*PUSH:Parameter*/ inputParameter.@ParameterName /*PUSH:Parameter*//*IF:MethodParameter.IsPropertyValue*//*LOOP:InputParameters*/;
                                #endregion IF Method.PropertyParameter
                                #region NOT Method.PropertyParameter
                                Value.@PropertyName = /*LOOP:InputParameters*/ inputParameter./*PUSH:Parameter*/ @ParameterName /*PUSH:Parameter*//*LOOP:InputParameters*/;
                                #endregion NOT Method.PropertyParameter
                                #endregion NOT Method.IsGetMember
                                #endregion IF MemberIndex
                                #region NOT MemberIndex
                                /*IF:MethodIsReturn*/
                                @ReturnName = /*NOTE*/ (MethodReturnType.FullName) /*NOTE*//*IF:MethodIsReturn*//*PUSH:Method*/ Value.@MethodName/*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(@MethodIdentityCommand, 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);
                    }
                }