dropConnections method
Closes every connection, as if the network failed. Clients see the connection lost and start reconnecting.
Implementation
Future<void> dropConnections() async {
for (final connection in List.of(_connections)) {
await connection.close();
}
_connections.clear();
}