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

Method createNcProcess

src/extension/flutter/flutter_daemon.ts:108–118  ·  view source on GitHub ↗
(port: number)

Source from the content-addressed store, hash-verified

106 // has forwarded this port to the remote machine where the Dart extension is running. Netcat is used to access the local devices,
107 // instead of starting another daemon process on the remote machine.
108 protected createNcProcess(port: number) {
109 this.process = child_process.spawn("nc", ["localhost", port.toString()]) satisfies SpawnedProcess;
110
111 this.process.stdout.on("data", (data: Buffer | string) => this.handleStdOut(data));
112 this.process.stderr.on("data", (data: Buffer | string) => this.handleStdErr(data));
113 this.process.on("exit", (code, signal) => this.handleExit(code, signal));
114 this.process.on("error", (error) => {
115 void vs.window.showErrorMessage(`Remote daemon startup had an error: ${error}. Check the instructions for using dart.daemonPort`);
116 this.handleError(error);
117 });
118 }
119
120 protected handleExit(code: number | null, signal: NodeJS.Signals | null) {
121 if (code && !this.isShuttingDown)

Callers 1

constructorMethod · 0.95

Calls 5

handleExitMethod · 0.95
spawnMethod · 0.80
onMethod · 0.80
toStringMethod · 0.45
handleErrorMethod · 0.45

Tested by

no test coverage detected