コード例 #1
0
        public async Task <Result> SendRequestAsync(Request outboundRequest)
        {
            var sendRequest = await _requestSender.SendAsync(outboundRequest);

            if (sendRequest.Success)
            {
                return(Result.Ok());
            }

            outboundRequest.Status = RequestStatus.Error;
            HandleFailedRequest(outboundRequest);
            ReportError(sendRequest.Error);

            return(Result.Fail(sendRequest.Error));
        }
コード例 #2
0
        public async Task <Result> AcceptInboundFileTransferAsync(Request outboundRequest)
        {
            _transferRequestSender = new RequestSender(_localServerInfo, _settings);
            _transferRequestSender.EventOccurred           += HandleServerEvent;
            _transferRequestSender.SuccessfullySentRequest += HandleSentRequest;

            var sendRequest = await _transferRequestSender.SendAsync(outboundRequest);

            if (sendRequest.Success)
            {
                return(Result.Ok());
            }

            outboundRequest.Status = RequestStatus.Error;
            HandleFailedRequest(outboundRequest);
            ReportError(sendRequest.Error);

            return(Result.Fail(sendRequest.Error));
        }