Esempio n. 1
0
        public static SendResult ParseSendResult(RemotingResponse remotingResponse)
        {
            Ensure.NotNull(remotingResponse, "remotingResponse");

            if (remotingResponse.ResponseCode == ResponseCode.Success)
            {
                var result = MessageUtils.DecodeMessageStoreResult(remotingResponse.ResponseBody);
                return(new SendResult(SendStatus.Success, result, null));
            }
            else if (remotingResponse.ResponseCode == 0)
            {
                return(new SendResult(SendStatus.Timeout, null, Encoding.UTF8.GetString(remotingResponse.ResponseBody)));
            }
            else
            {
                return(new SendResult(SendStatus.Failed, null, Encoding.UTF8.GetString(remotingResponse.ResponseBody)));
            }
        }