Beispiel #1
0
        public Mailbox TransportCall(Who recipient, Message msg)
        {
            if (msg.MessageId != null)
            {
                throw new Exception(" message has already been sent");
            }
            if (msg.InReplyTo != null)
            {
                throw new Exception(" message is marked as a reply");
            }

            long mid = idGen.Next();

            msg.MessageId = mid;
            Mailbox mb = new PlainMailbox(this, mid);

            Register(mb);
            try
            {
                transport.TransportMessage(recipient, msg);
            }
            catch (Exception e)
            {
                Unregister(mb);
                throw e;
            }
            return(mb);
        }
Beispiel #2
0
 public virtual void TransportMessage(Who recipient, Message msg)
 {
     transport.TransportMessage(recipient, msg);
 }