expo-desktop 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,10 +23,10 @@ export async function testPortAsync(port, hostnames) {
23
23
  return false;
24
24
  }
25
25
  }
26
- // On Windows, a wildcard IPv6 bind can succeed while an existing IPv4
27
- // listener still owns the same port. Consult the OS listener table after
28
- // the bind probe so loopback and wildcard listeners are both detected.
29
- if (process.platform === "win32" && (await getPID(port)) !== null) {
26
+ // A wildcard bind can succeed while an existing listener on another address
27
+ // still owns the same port. Confirm against the OS listener table on every
28
+ // platform so loopback and wildcard listeners are both detected.
29
+ if ((await getPID(port)) !== null) {
30
30
  return false;
31
31
  }
32
32
  return true;
@@ -12,7 +12,7 @@ export async function getPID(port) {
12
12
  return getWindowsPIDAsync(port);
13
13
  }
14
14
  try {
15
- const { stdout } = await spawnAsync("lsof", [`-i:${port}`, "-P", "-t", "-sTCP:LISTEN"], {
15
+ const { stdout } = await spawnAsync("lsof", [`-iTCP:${port}`, "-nP", "-t", "-sTCP:LISTEN"], {
16
16
  timeout,
17
17
  });
18
18
  const pid = Number(stdout.split("\n", 1)[0].trim());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-desktop",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Best-effort desktop support for Expo",
5
5
  "keywords": [
6
6
  "android",
@@ -78,7 +78,13 @@ function run(argv) {
78
78
 
79
79
  updateTerminatedProcessIds(workspace);
80
80
  if (terminatedProcessIds.size < processIds.size) {
81
- $.CFRunLoopRunInMode($.kCFRunLoopDefaultMode, terminationTimeoutSeconds, false);
81
+ if (terminationTimeoutSeconds === 0) {
82
+ // Zero means no timeout here; CFRunLoopRunInMode(..., 0, ...) only runs once.
83
+ // The observer stops this loop when every matching app has exited.
84
+ $.CFRunLoopRun();
85
+ } else {
86
+ $.CFRunLoopRunInMode($.kCFRunLoopDefaultMode, terminationTimeoutSeconds, false);
87
+ }
82
88
  }
83
89
 
84
90
  workspace.removeObserverForKeyPath(observer, "runningApplications");