protected void Send(Contact destination, Guid consumerId, byte flag, byte[] data, bool reliable = true, bool ordered = true, int channel = 1)
        {
            byte[] packet = new byte[data.Length + 1];
            packet[0] = flag;
            Array.ConstrainedCopy(data, 0, packet, 1, data.Length);

            destination.Send(RoutingTable.LocalContact, consumerId, packet, reliable, ordered, channel);
        }
 /// <summary>
 /// Sends the response back to the remote end
 /// </summary>
 /// <param name="local">The local contact</param>
 /// <param name="target">The target.</param>
 /// <param name="callbackId">The callback id.</param>
 /// <param name="responseBytes">The response bytes.</param>
 public void SendResponse(Contact local, Contact target, long callbackId, byte[] responseBytes)
 {
     using (MemoryStream m = new MemoryStream())
     {
         Serializer.SerializeWithLengthPrefix<Response>(m, new Response(callbackId, responseBytes), PrefixStyle.Base128);
         target.Send(local, ConsumerId, m.ToArray());
     }
 }
 /// <summary>
 /// Sends the response back to the remote end
 /// </summary>
 /// <param name="local">The local contact</param>
 /// <param name="target">The target.</param>
 /// <param name="callbackId">The callback id.</param>
 /// <param name="responseBytes">The response bytes.</param>
 public void SendResponse(Contact local, Contact target, long callbackId, byte[] responseBytes)
 {
     using (MemoryStream m = new MemoryStream())
     {
         Serializer.Serialize<Response>(m, new Response(callbackId, responseBytes));
         target.Send(local, ConsumerId, m.ToArray());
     }
 }