Skip to content

Commit 825e97d

Browse files
committed
doc: do not mention TCP in the allowHalfOpen option description
The `allowHalfOpen` option works in the same way for both TCP and IPC connections. Fixes: #38307
1 parent 9f5977a commit 825e97d

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

doc/api/net.md

+18-16
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,9 @@ changes:
551551
* `options` {Object} Available options are:
552552
* `fd` {number} If specified, wrap around an existing socket with
553553
the given file descriptor, otherwise a new socket will be created.
554-
* `allowHalfOpen` {boolean} Indicates whether half-opened TCP connections
555-
are allowed. See [`net.createServer()`][] and the [`'end'`][] event
556-
for details. **Default:** `false`.
554+
* `allowHalfOpen` {boolean} Indicates whether to automatically end the
555+
writable side when the readable side ends. See [`net.createServer()`][] and
556+
the [`'end'`][] event for details. **Default:** `false`.
557557
* `readable` {boolean} Allow reads on the socket when an `fd` is passed,
558558
otherwise ignored. **Default:** `false`.
559559
* `writable` {boolean} Allow writes on the socket when an `fd` is passed,
@@ -612,14 +612,14 @@ See also: the return values of `socket.write()`.
612612
added: v0.1.90
613613
-->
614614

615-
Emitted when the other end of the socket sends a FIN packet, thus ending the
616-
readable side of the socket.
615+
Emitted when the other end of the socket signals the end of transmission, thus
616+
ending the readable side of the socket.
617617

618-
By default (`allowHalfOpen` is `false`) the socket will send a FIN packet
619-
back and destroy its file descriptor once it has written out its pending
620-
write queue. However, if `allowHalfOpen` is set to `true`, the socket will
621-
not automatically [`end()`][`socket.end()`] its writable side, allowing the
622-
user to write arbitrary amounts of data. The user must call
618+
By default (`allowHalfOpen` is `false`) the socket will send an end of
619+
transmission packet back and destroy its file descriptor once it has written out
620+
its pending write queue. However, if `allowHalfOpen` is set to `true`, the
621+
socket will not automatically [`end()`][`socket.end()`] its writable side,
622+
allowing the user to write arbitrary amounts of data. The user must call
623623
[`end()`][`socket.end()`] explicitly to close the connection (i.e. sending a
624624
FIN packet back).
625625

@@ -1295,8 +1295,8 @@ added: v0.5.0
12951295
-->
12961296

12971297
* `options` {Object}
1298-
* `allowHalfOpen` {boolean} Indicates whether half-opened TCP
1299-
connections are allowed. **Default:** `false`.
1298+
* `allowHalfOpen` {boolean} Indicates whether to automatically end the
1299+
writable side when the readable side ends. **Default:** `false`.
13001300
* `pauseOnConnect` {boolean} Indicates whether the socket should be
13011301
paused on incoming connections. **Default:** `false`.
13021302
* `connectionListener` {Function} Automatically set as a listener for the
@@ -1306,10 +1306,12 @@ added: v0.5.0
13061306
Creates a new TCP or [IPC][] server.
13071307

13081308
If `allowHalfOpen` is set to `true`, when the other end of the socket
1309-
sends a FIN packet, the server will only send a FIN packet back when
1310-
[`socket.end()`][] is explicitly called, until then the connection is
1311-
half-closed (non-readable but still writable). See [`'end'`][] event
1312-
and [RFC 1122][half-closed] (section 4.2.2.13) for more information.
1309+
signals the end of transmission, the server will only send back the end of
1310+
transmission when [`socket.end()`][] is explicitly called. For example, in the
1311+
context of TCP, when a FIN packed is received, a FIN packed is sent
1312+
back only when [`socket.end()`][] is explicitly called. Until then the
1313+
connection is half-closed (non-readable but still writable). See [`'end'`][]
1314+
event and [RFC 1122][half-closed] (section 4.2.2.13) for more information.
13131315

13141316
If `pauseOnConnect` is set to `true`, then the socket associated with each
13151317
incoming connection will be paused, and no data will be read from its handle.

doc/api/tls.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,7 @@ changes:
14731473
responsibility; calling `tls.connect()` will not cause `net.connect()` to be
14741474
called.
14751475
* `allowHalfOpen` {boolean} If the `socket` option is missing, indicates
1476-
whether or not to allow the internally created socket to be half-open,
1476+
whether to automatically end the writable side when the readable side ends,
14771477
otherwise the option is ignored. See the `allowHalfOpen` option of
14781478
[`net.Socket`][] for details. **Default:** `false`.
14791479
* `rejectUnauthorized` {boolean} If not `false`, the server certificate is

0 commit comments

Comments
 (0)