Beispiel #1
0
 /// <summary>
 /// Broadcast a message to all connected nodes, namely <see cref="Connections"/>.
 /// </summary>
 /// <param name="message">The message to be broadcasted.</param>
 private void BroadcastMessage(Message message) => SendToRemoteNodes(message);
 private void EnqueueMessage(MessageCommand command, ISerializable payload = null)
 {
     EnqueueMessage(Message.Create(command, payload));
 }
Beispiel #3
0
 /// <summary>
 /// Packs a MessageCommand to a full Message with an optional ISerializable payload.
 /// Forwards it to <see cref="BroadcastMessage(Message message)"/>.
 /// </summary>
 /// <param name="command">The message command to be packed.</param>
 /// <param name="payload">Optional payload to be Serialized along the message.</param>
 private void BroadcastMessage(MessageCommand command, ISerializable payload = null)
 {
     BroadcastMessage(Message.Create(command, payload));
 }
 private void SendMessage(Message message)
 {
     ack = false;
     SendData(ByteString.FromBytes(message.ToArray()));
 }