(opts: ListenOptions)
| 115 | } |
| 116 | |
| 117 | function startWithPortFallback(opts: ListenOptions) { |
| 118 | if (opts.port !== 0) return startListener(opts, opts.port) |
| 119 | // Match the legacy listener port-resolution behavior: explicit `0` prefers |
| 120 | // 4096 first, then any free port. |
| 121 | return startListener(opts, 4096).pipe(Effect.catch(() => startListener(opts, 0))) |
| 122 | } |
| 123 | |
| 124 | function startListener(opts: ListenOptions, port: number) { |
| 125 | const scope = Scope.makeUnsafe() |
no test coverage detected