GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore(shared): simplify port availability comment · pingdotgg/t3code@86394f1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/shared/src
    • Net.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/shared/src/Net.ts‎

Copy file name to clipboardExpand all lines: packages/shared/src/Net.ts
+1-6Lines 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 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.