From 13cb8a69e4704922646720aaa6e8be5acd4e076c Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 27 Feb 2017 05:24:11 +0100 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/11573 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- lib/net.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/net.js b/lib/net.js index 2528daedc84ef5..f3f8bb1a984ea8 100644 --- a/lib/net.js +++ b/lib/net.js @@ -208,10 +208,6 @@ Socket.prototype._unrefTimer = function _unrefTimer() { // the user has called .end(), and all the bytes have been // sent out to the other side. -// If allowHalfOpen is false, or if the readable side has -// ended already, then destroy. -// If allowHalfOpen is true, then we need to do a shutdown, -// so that only the writable side will be cleaned up. function onSocketFinish() { // If still connecting - defer handling 'finish' until 'connect' will happen if (this.connecting) {