Skip to content

Commit

Permalink
net: remove misleading comment
Browse files Browse the repository at this point in the history
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: nodejs/node#11573
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
bnoordhuis authored and andrew749 committed Jul 19, 2017
1 parent 0134e8f commit 7b305b1
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,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) {
Expand Down

0 comments on commit 7b305b1

Please sign in to comment.