@@ -419,9 +419,10 @@ added: v0.3.4
419
419
* ` options ` {Object} Available options are:
420
420
* ` fd ` {number} If specified, wrap around an existing socket with
421
421
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 ` .
425
426
* ` readable ` {boolean} Allow reads on the socket when an ` fd ` is passed,
426
427
otherwise ignored. ** Default:** ` false ` .
427
428
* ` writable ` {boolean} Allow writes on the socket when an ` fd ` is passed,
@@ -478,14 +479,14 @@ See also: the return values of `socket.write()`.
478
479
added: v0.1.90
479
480
-->
480
481
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.
483
484
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
489
490
[ ` end() ` ] [ `socket.end()` ] explicitly to close the connection (i.e. sending a
490
491
FIN packet back).
491
492
@@ -1161,8 +1162,9 @@ added: v0.5.0
1161
1162
-->
1162
1163
1163
1164
* ` 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 ` .
1166
1168
* ` pauseOnConnect ` {boolean} Indicates whether the socket should be
1167
1169
paused on incoming connections. ** Default:** ` false ` .
1168
1170
* ` connectionListener ` {Function} Automatically set as a listener for the
@@ -1172,10 +1174,12 @@ added: v0.5.0
1172
1174
Creates a new TCP or [ IPC] [ ] server.
1173
1175
1174
1176
If ` 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.
1179
1183
1180
1184
If ` pauseOnConnect ` is set to ` true ` , then the socket associated with each
1181
1185
incoming connection will be paused, and no data will be read from its handle.
0 commit comments