broadcast<T extends DataObject, V extends DataResolver<T>> method

  1. @mustCallSuper
void broadcast<T extends DataObject, V extends DataResolver<T>>(
  1. T data, {
  2. Connection? exclude,
})

Broadcasts data to all connections.

If exclude is provided, the data will not be sent to that connection.

Implementation

@mustCallSuper
void broadcast<T extends DataObject, V extends DataResolver<T>>(
  T data, {
  Connection? exclude,
}) {
  for (final connection in connections) {
    if (connection == exclude) continue;
    send<T, V>(data, connection);
  }
}