Skip to content

Commit 13cb8a6

Browse files
bnoordhuisaddaleax
authored andcommitted
net: remove misleading comment
The allowHalfOpen comment was added in commit 8a3befa ("net: Refactor to use streams2") from 2012 but it wasn't true even then as far as I can tell: Node.js simply always does a shutdown(2) first. It is true that streams2 withholds the 'end' event when allowHalfOpen is true but the comment is about a callback that hangs off the 'finish' event that is emitted after calling `socket.end()`. PR-URL: #11573 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent a0c117b commit 13cb8a6

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

lib/net.js

-4
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,6 @@ Socket.prototype._unrefTimer = function _unrefTimer() {
208208

209209
// the user has called .end(), and all the bytes have been
210210
// sent out to the other side.
211-
// If allowHalfOpen is false, or if the readable side has
212-
// ended already, then destroy.
213-
// If allowHalfOpen is true, then we need to do a shutdown,
214-
// so that only the writable side will be cleaned up.
215211
function onSocketFinish() {
216212
// If still connecting - defer handling 'finish' until 'connect' will happen
217213
if (this.connecting) {

0 commit comments

Comments
 (0)