Broadcasts an event to all sockets listening on a channel.

def broadcast(self, channel, event, data):
        """Broadcasts an event to all sockets listening on a channel."""
        payload = self._server.serialize_event(event, data)
        for socket_id in self.subscriptions.get(channel, ()):
            rv = self._server.sockets.get(socket_id)
            if rv is not None:
                rv.socket.send(payload)