Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: more test coverage for maxConnections #1855

Closed
wants to merge 1 commit into from

Conversation

Trott
Copy link
Member

@Trott Trott commented May 31, 2015

If the server is not accepting connections because maxConnections
is exceeded, the server should start accepting connections again
when a connection closes.

Eliminates a TODO comment. ref: #264

@mscdex mscdex added test Issues and PRs related to the tests. net Issues and PRs related to the net subsystem. labels May 31, 2015
server.listen(common.PORT, function() {
createConnection(0)
.then(createConnection.bind(null, 1))
.then(function() {connections[0].end();})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: space between { }

@Trott
Copy link
Member Author

Trott commented May 31, 2015

Updated the branch to conform to the style comments from @brendanashworth.


var server = net.createServer(function(socket) {
socket.on('data', function(data) {
console.error('received message: ' + data.toString());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the data.toString is unnecessary here

@brendanashworth
Copy link
Contributor

Thanks for adding this test, it was really bad that something like this was untested beforehand.

@Trott
Copy link
Member Author

Trott commented Jun 2, 2015

Updated commit based on all comments from @brendanashworth

.then(closeConnection.bind(null, 2));
});

process.on('exit', function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: no space after function, so function() {

@brendanashworth
Copy link
Contributor

Sorry I missed the little style nitpick. Other than that, this LGTM.

edit: good use of promises btw 😄

If the server is not accepting connections because maxConnections
is exceeded, the server should start accepting connections again
when a connection closes.
@Trott
Copy link
Member Author

Trott commented Jun 3, 2015

OK, nit picked, new commit pushed!

brendanashworth pushed a commit that referenced this pull request Jun 3, 2015
If the server is not accepting connections because maxConnections
is exceeded, the server should start accepting connections again
when a connection closes.

PR-URL: #1855
Reviewed-By: Brendan Ashworth <[email protected]>
@brendanashworth
Copy link
Contributor

Thanks, landed in bd99e8d.

andrewdeandrade pushed a commit to andrewdeandrade/node that referenced this pull request Jun 3, 2015
If the server is not accepting connections because maxConnections
is exceeded, the server should start accepting connections again
when a connection closes.

PR-URL: nodejs/node#1855
Reviewed-By: Brendan Ashworth <[email protected]>
@cjihrig cjihrig mentioned this pull request Jun 4, 2015
@rvagg rvagg mentioned this pull request Jun 11, 2015
@Trott Trott deleted the maxconnect branch October 14, 2021 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
net Issues and PRs related to the net subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants