connect method
Sets the Dart Tooling Daemon connection to point to uri.
Before connecting to uri, if a current connection exists, then
disconnect is called to close it.
If the connection fails, will retry with exponential backoff up to
maxRetries.
Implementation
Future<void> connect(
Uri uri, {
void Function(Object, StackTrace?)? onError,
int maxRetries = 5,
}) {
// On explicit connections, we capture the connect function so that we
// can call it again if [reconnect()] is called.
final connectFunc = _lastConnectFunc =
() => _connectImpl(uri, onError: onError, maxRetries: maxRetries);
return connectFunc();
}