/// <summary> /// 同步函数客户端 async / await 测试 /// </summary> /// <param name="left">加法左值</param> /// <param name="right">加法右值</param> public async System.Threading.Tasks.Task<AutoCSer.Net.TcpServer.ReturnValue<int>> AddAsync(int left, int right) { AutoCSer.Net.TcpOpenStreamServer.ClientSocketSender _socket_ = _TcpClient_.Sender; if (_socket_ != null) { AutoCSer.Net.TcpServer.TaskAsyncReturnValue<TcpOpenStreamServer._p2> _wait_ = new AutoCSer.Net.TcpServer.TaskAsyncReturnValue<TcpOpenStreamServer._p2>(); TcpOpenStreamServer._p1 _inputParameter_ = new TcpOpenStreamServer._p1 { left = left, right = right, }; AutoCSer.Net.TcpServer.ReturnType _returnType_; TcpOpenStreamServer._p2 _outputParameter_ = new TcpOpenStreamServer._p2 { }; if ((_returnType_ = _socket_.GetAsync<TcpOpenStreamServer._p1, TcpOpenStreamServer._p2>(_a0, _wait_, ref _inputParameter_, ref _outputParameter_)) == AutoCSer.Net.TcpServer.ReturnType.Success) { AutoCSer.Net.TcpServer.ReturnValue<TcpOpenStreamServer._p2> _returnOutputParameter_ = await _wait_; return new AutoCSer.Net.TcpServer.ReturnValue<int> { Type = _returnOutputParameter_.Type, Value = _returnOutputParameter_.Value.Return }; } return new AutoCSer.Net.TcpServer.ReturnValue<int> { Type = _returnType_ }; } return new AutoCSer.Net.TcpServer.ReturnValue<int> { Type = AutoCSer.Net.TcpServer.ReturnType.ClientException }; }
/// <summary> /// 无需 TCP 远程函数申明配置测试 /// </summary> /// <param name="left">加法左值</param> /// <param name="right">加法右值</param> public AutoCSer.Net.TcpServer.ReturnValue <int> Add(int left, int right) { AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpOpenStreamServer._p2> _wait_ = AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpOpenStreamServer._p2> .Pop(); try { AutoCSer.Net.TcpOpenStreamServer.ClientSocketSender _socket_ = _TcpClient_.Sender; if (_socket_ != null) { TcpOpenStreamServer._p1 _inputParameter_ = new TcpOpenStreamServer._p1 { left = left, right = right, }; TcpOpenStreamServer._p2 _outputParameter_ = new TcpOpenStreamServer._p2 { }; AutoCSer.Net.TcpServer.ReturnType _returnType_ = _socket_.WaitGet <TcpOpenStreamServer._p1, TcpOpenStreamServer._p2>(_c0, ref _wait_, ref _inputParameter_, ref _outputParameter_); return(new AutoCSer.Net.TcpServer.ReturnValue <int> { Type = _returnType_, Value = _outputParameter_.Return }); } } finally { if (_wait_ != null) { AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpOpenStreamServer._p2> .PushNotNull(_wait_); } } return(new AutoCSer.Net.TcpServer.ReturnValue <int> { Type = AutoCSer.Net.TcpServer.ReturnType.ClientException }); }
public AutoCSer.Net.TcpServer.ReturnValue <int> this[int index] { get { AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpOpenStreamServer._p1> _wait_ = AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpOpenStreamServer._p1> .Pop(); try { AutoCSer.Net.TcpOpenStreamServer.ClientSocketSender _socket_ = _TcpClient_.Sender; if (_socket_ != null) { TcpOpenStreamServer._p2 _inputParameter_ = new TcpOpenStreamServer._p2 { index = index, }; AutoCSer.Net.TcpServer.ReturnValue <TcpOpenStreamServer._p1> _outputParameter_ = _socket_.WaitGet <TcpOpenStreamServer._p2, TcpOpenStreamServer._p1>(_c1, ref _wait_, ref _inputParameter_); return(new AutoCSer.Net.TcpServer.ReturnValue <int> { Type = _outputParameter_.Type, Value = _outputParameter_.Value.Return }); } } finally { if (_wait_ != null) { AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpOpenStreamServer._p1> .PushNotNull(_wait_); } } return(new AutoCSer.Net.TcpServer.ReturnValue <int> { Type = AutoCSer.Net.TcpServer.ReturnType.ClientException }); } set { AutoCSer.Net.TcpServer.AutoWaitReturnValue _wait_ = AutoCSer.Net.TcpServer.AutoWaitReturnValue.Pop(); try { AutoCSer.Net.TcpOpenStreamServer.ClientSocketSender _socket_ = _TcpClient_.Sender; if (_socket_ != null) { TcpOpenStreamServer._p3 _inputParameter_ = new TcpOpenStreamServer._p3 { index = index, value = value, }; AutoCSer.Net.TcpServer.ReturnType _returnType_ = _socket_.WaitCall(_c2, ref _wait_, ref _inputParameter_); if (_returnType_ == AutoCSer.Net.TcpServer.ReturnType.Success) { return; } throw new Exception(_returnType_.ToString()); } } finally { if (_wait_ != null) { AutoCSer.Net.TcpServer.AutoWaitReturnValue.PushNotNull(_wait_); } } throw new Exception(AutoCSer.Net.TcpServer.ReturnType.ClientException.ToString()); } }