send<T extends DataObject, V extends DataResolver<T> > method
- @mustCallSuper
- T data,
- 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);
}