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

  1. @mustCallSuper
void send<T extends DataObject, V extends DataResolver<T>>(
  1. T data,
  2. Connection connection
)

Sends data to a connection.

Implementation

@mustCallSuper
void send<T extends DataObject, V extends DataResolver<T>>(
  T data,
  Connection connection,
) {
  // If the connection is not yet confirmed, send a connection accepted
  // before sending the data.
  final index = _connections.indexOf(connection);
  if (index != -1 && !_confirmedConnections[index]) {
    rawSend(
      ConnectionAccepted(connectionId: index),
      connection.address,
      connection.salt,
    );
  }
  rawSend(data, connection.address, connection.salt);
}