예제 #1
0
        public static SendResult ParseSendResult(RemotingResponse remotingResponse)
        {
            Ensure.NotNull(remotingResponse, "remotingResponse");

            if (remotingResponse.Code == ResponseCode.Success)
            {
                var messageResult = MessageUtils.DecodeMessageSendResponse(remotingResponse.Body);
                return(new SendResult(SendStatus.Success, messageResult, null));
            }
            else if (remotingResponse.Code == 0)
            {
                return(new SendResult(SendStatus.Timeout, null, Encoding.UTF8.GetString(remotingResponse.Body)));
            }
            else
            {
                return(new SendResult(SendStatus.Failed, null, Encoding.UTF8.GetString(remotingResponse.Body)));
            }
        }