/// <summary> /// TBD /// </summary> /// <param name="localAddress">TBD</param> /// <param name="recipient">TBD</param> /// <param name="serializedMessage">TBD</param> /// <param name="senderOption">TBD</param> /// <param name="seqOption">TBD</param> /// <param name="ackOption">TBD</param> /// <returns>TBD</returns> public override ByteString ConstructMessage(Address localAddress, IActorRef recipient, SerializedMessage serializedMessage, IActorRef senderOption = null, SeqNo seqOption = null, Ack ackOption = null) { var ackAndEnvelope = new AckAndEnvelopeContainer(); var envelope = new RemoteEnvelope() { Recipient = SerializeActorRef(recipient.Path.Address, recipient) }; if (senderOption != null && senderOption.Path != null) { envelope.Sender = SerializeActorRef(localAddress, senderOption); } if (seqOption != null) { envelope.Seq = (ulong)seqOption.RawValue; } else { envelope.Seq = SeqUndefined; } if (ackOption != null) { ackAndEnvelope.Ack = AckBuilder(ackOption); } envelope.Message = serializedMessage; ackAndEnvelope.Envelope = envelope; return(ackAndEnvelope.ToByteString()); }
public override ByteString ConstructMessage(Address localAddress, IActorRef recipient, SerializedMessage serializedMessage, IActorRef senderOption = null, SeqNo seqOption = null, Ack ackOption = null) { var ackAndEnvelopeBuilder = AckAndEnvelopeContainer.CreateBuilder(); var envelopeBuilder = RemoteEnvelope.CreateBuilder().SetRecipient(SerializeActorRef(recipient.Path.Address, recipient)); if (senderOption != null && senderOption.Path != null) { envelopeBuilder = envelopeBuilder.SetSender(SerializeActorRef(localAddress, senderOption)); } if (seqOption != null) { envelopeBuilder = envelopeBuilder.SetSeq((ulong)seqOption.RawValue); } if (ackOption != null) { ackAndEnvelopeBuilder = ackAndEnvelopeBuilder.SetAck(AckBuilder(ackOption)); } envelopeBuilder = envelopeBuilder.SetMessage(serializedMessage); ackAndEnvelopeBuilder = ackAndEnvelopeBuilder.SetEnvelope(envelopeBuilder); return(ackAndEnvelopeBuilder.Build().ToByteString()); }