static void LogWithAddress(MessagePayload toHandle)
 {
     Logger.Debug("Handling sent message {0} for {1} from {2}",
         toHandle.Id,
         toHandle.GetToAddress().Channel,
         toHandle.GetToAddress().Server.Address);
 }
        public void Enqueue(MessagePayload toEnqueue)
        {
            Contract.Requires(toEnqueue != null);

            CreateQueueIfNonExistant(toEnqueue.GetToAddress().Server);

            queues[toEnqueue.GetToAddress().Server].Enqueue(toEnqueue);
        }
        public override void InputMessage(MessagePayload toInput)
        {
            if(!toInput.HasBody()) return;
            if(toInput.GetToAddress() != address) return;

            OnMessageProcessed(toInput);
        }
        public void HandleMessage(MessagePayload toHandle, List<MessagePayload> outgoingMessages)
        {
            if (!toHandle.IsDirectChannelMessage()) return;

            using (var context = new DirectReplyContext(toHandle.GetToAddress(), toHandle.GetFromAddress()))
            {
                messageReceiver.InputMessage(toHandle);
                outgoingMessages.AddRange(context.GetCurrentReplies());
            }
        }
 public void TransportMessage(
     MessagePayload toTransport,
     Action<Exception> onException,
     Action onCompletion,
     Action<IEnumerable<MessagePayload>> onReceiveMessages)
 {
     requestor.SendPut(
         toTransport.GetToAddress().Server.GetUrl(),
         requestStream => formatter.Serialise(requestStream, toTransport),
         s => RecieveResponse(s, onReceiveMessages),
         onException,
         onCompletion);
 }
 public override void InputMessage(MessagePayload toInput)
 {
     address.Value = toInput.GetToAddress();
     base.InputMessage(toInput);
 }
 protected override EndpointAddress GetAddress(MessagePayload toInput)
 {
     return toInput.GetToAddress();
 }
 void SetCurrentReceiverAddress(MessagePayload toInput)
 {
     this.addressLookup.SetCurrentRecieverAddress(toInput.GetToAddress());
 }
 public void TransportMessage(MessagePayload toTransport)
 {
     requestor.SendPut(
         toTransport.GetToAddress().Server.GetUrl(),
         requestStream => formatter.Serialise(requestStream, toTransport));
 }