GetReturnAddress() публичный статический Метод

Gets the name of the return address from the provided value. If the target includes a machine name, uses the local machine name in the returned value otherwise uses the local IP address in the returned value.
public static GetReturnAddress ( Address value, Address target ) : string
value Address
target Address
Результат string
        void IMessageTransport.SendMessage(Message message, Address targetAddress)
        {
            if (message == null)
            {
                throw new ArgumentNullException("message");
            }
            if (targetAddress == null)
            {
                throw new ArgumentNullException("targetAddress");
            }

            var queuePath = MsmqUtilities.GetFullPath(targetAddress);

            try
            {
                using (var messageQueue = new MessageQueue(queuePath, QueueAccessMode.SendAndReceive))
                {
                    var toSend = MsmqUtilities.Convert(message);

                    if (message.ReplyToAddress != null)
                    {
                        toSend.ResponseQueue = new MessageQueue(MsmqUtilities.GetReturnAddress(message.ReplyToAddress.ToString(), targetAddress.ToString()));
                    }

                    messageQueue.Send(toSend, MessageQueueTransactionType.Automatic);

                    message.Id = toSend.Id;
                }
            }
            catch (MessageQueueException ex)
            {
                if (ex.MessageQueueErrorCode == MessageQueueErrorCode.QueueNotFound)
                {
                    throw new EventSourcingException("消息队列未找到: [{0}]", targetAddress);
                }
                else
                {
                    throw new EventSourcingException("发送消息到队列时遇到异常,队列地址:{0},异常详情:{1}", targetAddress, ex);
                }
            }
            catch (Exception ex)
            {
                throw new EventSourcingException("发送消息到队列时遇到异常,队列地址:{0},异常详情:{1}", targetAddress, ex);
            }
        }