/// <summary> /// /// </summary> public void PushStamp(EnvelopeStamp stamp) { lock (_stamps) { _stamps.Add(stamp); } }
/// <summary> /// Addressed envelope. /// </summary> protected Outcomes Send(Envelope envelope) { if (envelope.Address != null) { EnvelopeStamp stamp = envelope.Address.PopStamp(); if (stamp != null) { return(Send(stamp.SenderIndex, stamp.ReceiverIndex, envelope, null, false)); } } return(Outcomes.Failure); }
/// <summary> /// Create a responding envelope transport. /// </summary> public static EnvelopeTransportation CreateResponseTransport(EnvelopeTransportation transport) { EnvelopeTransportation result = new EnvelopeTransportation(); List <EnvelopeStamp> responseStamps = new List <EnvelopeStamp>(); lock (transport._stamps) { for (int i = transport._stamps.Count - 1; i >= 0; i--) { EnvelopeStamp sourceStamp = transport._stamps[i]; EnvelopeStamp newStamp = new EnvelopeStamp(sourceStamp.MessageBusStampId, sourceStamp.SenderIndex, sourceStamp.ReceiverIndex); result._stamps.Add(newStamp); } } return(result); }
/// <summary> /// Create a responding envelope transport. /// </summary> public static EnvelopeTransportation CreateResponseTransport(EnvelopeTransportation transport) { EnvelopeTransportation result = new EnvelopeTransportation(); List<EnvelopeStamp> responseStamps = new List<EnvelopeStamp>(); lock (transport._stamps) { for (int i = transport._stamps.Count - 1; i >= 0; i--) { EnvelopeStamp sourceStamp = transport._stamps[i]; EnvelopeStamp newStamp = new EnvelopeStamp(sourceStamp.MessageBusStampId, sourceStamp.SenderIndex, sourceStamp.ReceiverIndex); result._stamps.Add(newStamp); } } return result; }