MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / startPing

Method startPing

src/extension/flutter/flutter_daemon.ts:91–103  ·  view source on GitHub ↗
(customMessage?: string)

Source from the content-addressed store, hash-verified

89 }
90
91 public startPing(customMessage?: string) {
92 const prompt = customMessage ?? "The daemon connection was lost. Reload the extension to restart the daemon.";
93 this.pingIntervalId = setInterval(async () => {
94 try {
95 await withTimeout(this.daemonVersion(), "The daemon connection was lost", 10);
96 } catch (e) {
97 clearInterval(this.pingIntervalId);
98 this.logger.error(e);
99 this.hasShownTerminatedError = true;
100 void promptToReloadExtension(this.logger, { prompt, restartReason: ExtensionRestartReason.FlutterDaemonTerminatedPing });
101 }
102 }, 60 * 1000).unref();
103 }
104
105 // This is for the case where a user has started a flutter daemon process on their local machine where devices are available, and
106 // has forwarded this port to the remote machine where the Dart extension is running. Netcat is used to access the local devices,

Callers 1

constructorMethod · 0.95

Calls 4

daemonVersionMethod · 0.95
withTimeoutFunction · 0.90
promptToReloadExtensionFunction · 0.90
errorMethod · 0.65

Tested by

no test coverage detected