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); }
public static Task Push(Socket socket, string @event, JObject payload) { var broadcast = new Broadcast(socket.Topic, @event, payload); return socket.Transport.SendBroadcast(broadcast); }