Ejemplo n.º 1
0
 public static Message FromBroadcast(Broadcast broadcast) => new Message(broadcast.Topic, broadcast.Event, broadcast.Payload, null);
 /// <summary>
 /// Send a broadcast to the socket.
 /// </summary>
 public virtual Task SendBroadcast(Broadcast broadcast) => SendByteArray(_socketSerializer.SerializeBroadcast(broadcast));
 public ArraySegment<byte> SerializeBroadcast(Broadcast broadcast)
 {
     var message = Message.FromBroadcast(broadcast);
     return SerializeMessage(message);
 }        
Ejemplo n.º 4
0
 public static Task Push(Socket socket, string @event, JObject payload)
 {
     var broadcast = new Broadcast(socket.Topic, @event, payload);
     return socket.Transport.SendBroadcast(broadcast);
 }