net: return this from getConnections() · nodejs/node@a839aed · GitHub
Skip to content

Commit a839aed

Browse files
sam-githubaddaleax
authored andcommitted
net: return this from getConnections()
PR-URL: #13553 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 69f806c commit a839aed

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

doc/api/net.md

Lines changed: 2 additions & 0 deletions

lib/net.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,8 @@ Server.prototype.getConnections = function(cb) {
15581558
}
15591559

15601560
if (!this._usingSlaves) {
1561-
return end(null, this._connections);
1561+
end(null, this._connections);
1562+
return this;
15621563
}
15631564

15641565
// Poll slaves
@@ -1578,6 +1579,8 @@ Server.prototype.getConnections = function(cb) {
15781579
for (var n = 0; n < this._slaves.length; n++) {
15791580
this._slaves[n].getConnections(oncount);
15801581
}
1582+
1583+
return this;
15811584
};
15821585

15831586

test/parallel/test-net-pingpong.js

Lines changed: 7 additions & 4 deletions

0 commit comments

Comments
 (0)