@@ -419,9 +419,10 @@ added: v0.3.4
419419* ` options ` {Object} Available options are:
420420 * ` fd ` {number} If specified, wrap around an existing socket with
421421 the given file descriptor, otherwise a new socket will be created.
422- * ` allowHalfOpen ` {boolean} Indicates whether half-opened TCP connections
423- are allowed. See [ ` net.createServer() ` ] [ ] and the [ ` 'end' ` ] [ ] event
424- for details. ** Default:** ` false ` .
422+ * ` allowHalfOpen ` {boolean} If set to ` false ` , then the socket will
423+ automatically end the writable side when the readable side ends. See
424+ [ ` net.createServer() ` ] [ ] and the [ ` 'end' ` ] [ ] event for details. ** Default:**
425+ ` false ` .
425426 * ` readable ` {boolean} Allow reads on the socket when an ` fd ` is passed,
426427 otherwise ignored. ** Default:** ` false ` .
427428 * ` writable ` {boolean} Allow writes on the socket when an ` fd ` is passed,
@@ -478,14 +479,14 @@ See also: the return values of `socket.write()`.
478479added: v0.1.90
479480-->
480481
481- Emitted when the other end of the socket sends a FIN packet , thus ending the
482- readable side of the socket.
482+ Emitted when the other end of the socket signals the end of transmission , thus
483+ ending the readable side of the socket.
483484
484- By default (` allowHalfOpen ` is ` false ` ) the socket will send a FIN packet
485- back and destroy its file descriptor once it has written out its pending
486- write queue. However, if ` allowHalfOpen ` is set to ` true ` , the socket will
487- not automatically [ ` end() ` ] [ `socket.end()` ] its writable side, allowing the
488- user to write arbitrary amounts of data. The user must call
485+ By default (` allowHalfOpen ` is ` false ` ) the socket will send an end of
486+ transmission packet back and destroy its file descriptor once it has written out
487+ its pending write queue. However, if ` allowHalfOpen ` is set to ` true ` , the
488+ socket will not automatically [ ` end() ` ] [ `socket.end()` ] its writable side,
489+ allowing the user to write arbitrary amounts of data. The user must call
489490[ ` end() ` ] [ `socket.end()` ] explicitly to close the connection (i.e. sending a
490491FIN packet back).
491492
@@ -1161,8 +1162,9 @@ added: v0.5.0
11611162-->
11621163
11631164* ` options ` {Object}
1164- * ` allowHalfOpen ` {boolean} Indicates whether half-opened TCP
1165- connections are allowed. ** Default:** ` false ` .
1165+ * ` allowHalfOpen ` {boolean} If set to ` false ` , then the socket will
1166+ automatically end the writable side when the readable side ends.
1167+ ** Default:** ` false ` .
11661168 * ` pauseOnConnect ` {boolean} Indicates whether the socket should be
11671169 paused on incoming connections. ** Default:** ` false ` .
11681170* ` connectionListener ` {Function} Automatically set as a listener for the
@@ -1172,10 +1174,12 @@ added: v0.5.0
11721174Creates a new TCP or [ IPC] [ ] server.
11731175
11741176If ` allowHalfOpen ` is set to ` true ` , when the other end of the socket
1175- sends a FIN packet, the server will only send a FIN packet back when
1176- [ ` socket.end() ` ] [ ] is explicitly called, until then the connection is
1177- half-closed (non-readable but still writable). See [ ` 'end' ` ] [ ] event
1178- and [ RFC 1122] [ half-closed ] (section 4.2.2.13) for more information.
1177+ signals the end of transmission, the server will only send back the end of
1178+ transmission when [ ` socket.end() ` ] [ ] is explicitly called. For example, in the
1179+ context of TCP, when a FIN packed is received, a FIN packed is sent
1180+ back only when [ ` socket.end() ` ] [ ] is explicitly called. Until then the
1181+ connection is half-closed (non-readable but still writable). See [ ` 'end' ` ] [ ]
1182+ event and [ RFC 1122] [ half-closed ] (section 4.2.2.13) for more information.
11791183
11801184If ` pauseOnConnect ` is set to ` true ` , then the socket associated with each
11811185incoming connection will be paused, and no data will be read from its handle.
0 commit comments