Skip to content

Commit 86394f1

Browse files
chore(shared): simplify port availability comment
1 parent 131ca52 commit 86394f1

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

‎packages/shared/src/Net.ts‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ export class NetService extends Context.Service<NetService, NetServiceShape>()(
4444

4545
/** @public Service construction is part of the canonical Effect module API. */
4646
export const make = () => {
47-
/**
48-
* Returns true when a TCP server can bind to {host, port}.
49-
* `EADDRNOTAVAIL` (no such address, e.g. no `::1`) and `EAFNOSUPPORT` (no
50-
* IPv6 in the kernel, e.g. `ipv6.disable=1`) are treated as available so
51-
* IPv6-absent hosts don't fail availability checks.
52-
*/
5347
const canListenOnHost = (port: number, host: string): Effect.Effect<boolean> =>
5448
Effect.callback<boolean>((resume) => {
5549
const server = NodeNet.createServer();
@@ -64,6 +58,7 @@ export const make = () => {
6458
server.unref();
6559

6660
server.once("error", (cause) => {
61+
// Missing IPv6 addresses or kernel support do not mean the port is occupied.
6762
if (
6863
isErrnoExceptionWithCode(cause) &&
6964
(cause.code === "EADDRNOTAVAIL" || cause.code === "EAFNOSUPPORT")

0 commit comments

Comments
 (0)