Exemple #1
0
        public async Task <Response> SendAsync(Request req)
        {
            s_diagnosticListener.ClientRequest(req);
            Response response = null;

            try
            {
                req.RequestId = callBack.NewCallBackId();
                await SendRequestAsync(req);

                if (req.IsOneway)
                {
                    response = req.CreateResponse();
                }
                else
                {
                    response = await callBack.NewCallBackTask(req.RequestId, req.Timeout, req.ServantName, req.FuncName);

                    response.CheckResultStatus();
                    response.Codec = req.Codec;
                }

                return(response);
            }
            catch (Exception ex)
            {
                s_diagnosticListener.ClientException(req, response, ex);
                throw;
            }
            finally
            {
                s_diagnosticListener.ClientResponse(req, response);
            }
        }
Exemple #2
0
        public async Task <Response> SendAsync(Request req)
        {
            req.RequestId = callBack.NewCallBackId();
            await SendRequestAsync(req);

            if (req.IsOneway)
            {
                return(new Response());
            }
            else
            {
                var response = await callBack.NewCallBackTask(req.RequestId, req.Timeout, req.ServantName, req.FuncName);

                response.CheckResultStatus();
                response.Codec = req.Codec;
                return(response);
            }
        }