/// <summary>
            /// ref / out 参数测试
            /// </summary>
            /// <param name="left">加法左值</param>
            /// <param name="right">加法右值</param>
            /// <param name="product">乘积</param>
            /// <returns>和</returns>
            public AutoCSer.Net.TcpServer.ReturnValue <int> Add(int left, ref int right, out int product)
            {
                if (_isDisposed_ == 0)
                {
                    TcpOpenSimpleServer._p1 _inputParameter_ = new TcpOpenSimpleServer._p1
                    {
                        left = left,

                        right = right,
                    };
                    TcpOpenSimpleServer._p2 _outputParameter_ = new TcpOpenSimpleServer._p2
                    {
                        right = right,
                    };
                    AutoCSer.Net.TcpServer.ReturnType _returnType_ = _TcpClient_.Get <TcpOpenSimpleServer._p1, TcpOpenSimpleServer._p2>(_c0, ref _inputParameter_, ref _outputParameter_);

                    right = _outputParameter_.right;

                    product = _outputParameter_.product;
                    return(new AutoCSer.Net.TcpServer.ReturnValue <int> {
                        Type = _returnType_, Value = _outputParameter_.Return
                    });
                }
                product = default(int);
                return(new AutoCSer.Net.TcpServer.ReturnValue <int> {
                    Type = AutoCSer.Net.TcpServer.ReturnType.ClientException
                });
            }
Exemple #2
0
 /// <summary>
 /// 异步回调测试
 /// </summary>
 /// <param name="left">加法左值</param>
 /// <param name="right">加法右值</param>
 public AutoCSer.Net.TcpServer.ReturnValue<int> Add(int left, int right)
 {
     if (_isDisposed_ == 0)
     {
         TcpOpenSimpleServer._p1 _inputParameter_ = new TcpOpenSimpleServer._p1
         {
             
             left = left,
             
             right = right,
         };
         TcpOpenSimpleServer._p2 _outputParameter_ = new TcpOpenSimpleServer._p2
         {
         };
         AutoCSer.Net.TcpServer.ReturnType _returnType_ = _TcpClient_.Get<TcpOpenSimpleServer._p1, TcpOpenSimpleServer._p2>(_c0, ref _inputParameter_, ref _outputParameter_);
         return new AutoCSer.Net.TcpServer.ReturnValue<int> { Type = _returnType_, Value = _outputParameter_.Return };
     }
     return new AutoCSer.Net.TcpServer.ReturnValue<int> { Type = AutoCSer.Net.TcpServer.ReturnType.ClientException };
 }
            public AutoCSer.Net.TcpServer.ReturnValue <int> this[int index]
            {
                get
                {
                    if (_isDisposed_ == 0)
                    {
                        TcpOpenSimpleServer._p2 _inputParameter_ = new TcpOpenSimpleServer._p2
                        {
                            index = index,
                        };
                        TcpOpenSimpleServer._p1           _outputParameter_ = default(TcpOpenSimpleServer._p1);
                        AutoCSer.Net.TcpServer.ReturnType _returnType_      = _TcpClient_.Get <TcpOpenSimpleServer._p2, TcpOpenSimpleServer._p1>(_c1, ref _inputParameter_, ref _outputParameter_);
                        return(new AutoCSer.Net.TcpServer.ReturnValue <int> {
                            Type = _returnType_, Value = _outputParameter_.Return
                        });
                    }
                    return(new AutoCSer.Net.TcpServer.ReturnValue <int> {
                        Type = AutoCSer.Net.TcpServer.ReturnType.ClientException
                    });
                }
                set
                {
                    if (_isDisposed_ == 0)
                    {
                        TcpOpenSimpleServer._p3 _inputParameter_ = new TcpOpenSimpleServer._p3
                        {
                            index = index,

                            value = value,
                        };
                        AutoCSer.Net.TcpServer.ReturnType _returnType_ = _TcpClient_.Call(_c2, ref _inputParameter_);
                        if (_returnType_ == AutoCSer.Net.TcpServer.ReturnType.Success)
                        {
                            return;
                        }
                        throw new Exception(_returnType_.ToString());
                    }
                    throw new Exception(AutoCSer.Net.TcpServer.ReturnType.ClientException.ToString());
                }
            }