/// <summary> /// 计算任务测试 /// </summary> public void addThreadPool(int left, int right, Action <AutoCSer.Net.TcpServer.ReturnValue <AutoCSer.TestCase.TcpServerPerformance.Add> > _onReturn_) { AutoCSer.Net.Callback <AutoCSer.Net.TcpServer.ReturnValue <TcpOpenServer._p4> > _onOutput_ = _TcpClient_.GetCallback <AutoCSer.TestCase.TcpServerPerformance.Add, TcpOpenServer._p4>(_onReturn_); try { AutoCSer.Net.TcpOpenServer.ClientSocketSender _socket_ = _TcpClient_.Sender; if (_socket_ != null) { TcpOpenServer._p3 _inputParameter_ = new TcpOpenServer._p3 { left = left, right = right, }; _socket_.Get <TcpOpenServer._p3, TcpOpenServer._p4>(_ac6, ref _onOutput_, ref _inputParameter_); } } finally { if (_onOutput_ != null) { AutoCSer.Net.TcpServer.ReturnValue <TcpOpenServer._p4> _outputParameter_ = new AutoCSer.Net.TcpServer.ReturnValue <TcpOpenServer._p4> { Type = AutoCSer.Net.TcpServer.ReturnType.ClientException }; _onOutput_.Call(ref _outputParameter_); } } }
/// <summary> /// 客户端同步计算测试 /// </summary> public async System.Threading.Tasks.Task <AutoCSer.Net.TcpServer.ReturnValue <int> > addAsync(int left, int right) { AutoCSer.Net.TcpOpenServer.ClientSocketSender _socket_ = _TcpClient_.Sender; if (_socket_ != null) { AutoCSer.Net.TcpServer.TaskAsyncReturnValue <TcpOpenServer._p2> _wait_ = new AutoCSer.Net.TcpServer.TaskAsyncReturnValue <TcpOpenServer._p2>(); TcpOpenServer._p1 _inputParameter_ = new TcpOpenServer._p1 { left = left, right = right, }; AutoCSer.Net.TcpServer.ReturnType _returnType_; TcpOpenServer._p2 _outputParameter_ = new TcpOpenServer._p2 { }; if ((_returnType_ = _socket_.GetAsync <TcpOpenServer._p1, TcpOpenServer._p2>(_c0, _wait_, ref _inputParameter_, ref _outputParameter_)) == AutoCSer.Net.TcpServer.ReturnType.Success) { AutoCSer.Net.TcpServer.ReturnValue <TcpOpenServer._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 }); }
public void Callback(AutoCSer.Net.TcpServer.ReturnValue <@MethodReturnType.FullName> value) { @WebAjaxMethodType.FullName ajax = System.Threading.Interlocked.Exchange(ref Ajax, null); if (ajax != null) { Parameter.Return = value.Value; response(ajax, value.Type); } }
AutoCSer.Net.TcpServer.KeepCallback getLog(Action <AutoCSer.Net.TcpServer.ReturnValue <AutoCSer.Net.TcpRegister.ServerLog> > _onReturn_) { AutoCSer.Net.Callback <AutoCSer.Net.TcpServer.ReturnValue <TcpInternalServer._p3> > _onOutput_ = _TcpClient_.GetCallback <AutoCSer.Net.TcpRegister.ServerLog, TcpInternalServer._p3>(_onReturn_); try { AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = _TcpClient_.Sender; if (_socket_ != null) { return(_socket_.GetKeep <TcpInternalServer._p3>(_ac2, ref _onOutput_)); } } finally { if (_onOutput_ != null) { AutoCSer.Net.TcpServer.ReturnValue <TcpInternalServer._p3> _outputParameter_ = new AutoCSer.Net.TcpServer.ReturnValue <TcpInternalServer._p3> { Type = AutoCSer.Net.TcpServer.ReturnType.ClientException }; _onOutput_.Call(ref _outputParameter_); } } return(null); }
/// <summary> /// 获取消息 /// </summary> /// <returns>保持异步回调</returns> public AutoCSer.Net.TcpServer.KeepCallback getMessage(Action <AutoCSer.Net.TcpServer.ReturnValue <AutoCSer.TestCase.ChatData.Message> > _onReturn_) { AutoCSer.Net.Callback <AutoCSer.Net.TcpServer.ReturnValue <TcpOpenServer._p5> > _onOutput_ = _TcpClient_.GetCallback <AutoCSer.TestCase.ChatData.Message, TcpOpenServer._p5>(_onReturn_); try { AutoCSer.Net.TcpOpenServer.ClientSocketSender _socket_ = _TcpClient_.Sender; if (_socket_ != null) { return(_socket_.GetKeep <TcpOpenServer._p5>(_ac4, ref _onOutput_)); } } finally { if (_onOutput_ != null) { AutoCSer.Net.TcpServer.ReturnValue <TcpOpenServer._p5> _outputParameter_ = new AutoCSer.Net.TcpServer.ReturnValue <TcpOpenServer._p5> { Type = AutoCSer.Net.TcpServer.ReturnType.ClientException }; _onOutput_.Call(ref _outputParameter_); } } return(null); }
void addAsynchronous(int left, int right, Action <AutoCSer.Net.TcpServer.ReturnValue <AutoCSer.TestCase.TcpServerPerformance.Add> > _onReturn_) { AutoCSer.Net.Callback <AutoCSer.Net.TcpServer.ReturnValue <TcpInternalStreamServer._p4> > _onOutput_ = _TcpClient_.GetCallback <AutoCSer.TestCase.TcpServerPerformance.Add, TcpInternalStreamServer._p4>(_onReturn_); try { AutoCSer.Net.TcpInternalStreamServer.ClientSocketSender _socket_ = _TcpClient_.Sender; if (_socket_ != null) { TcpInternalStreamServer._p3 _inputParameter_ = new TcpInternalStreamServer._p3 { p0 = left, p1 = right, }; _socket_.Get <TcpInternalStreamServer._p3, TcpInternalStreamServer._p4>(_ac1, ref _onOutput_, ref _inputParameter_); } } finally { if (_onOutput_ != null) { AutoCSer.Net.TcpServer.ReturnValue <TcpInternalStreamServer._p4> _outputParameter_ = new AutoCSer.Net.TcpServer.ReturnValue <TcpInternalStreamServer._p4> { Type = AutoCSer.Net.TcpServer.ReturnType.ClientException }; _onOutput_.Call(ref _outputParameter_); } } }