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

By default allowHalfOpen should be false #10

Closed
wants to merge 1 commit into from
Closed

By default allowHalfOpen should be false #10

wants to merge 1 commit into from

Conversation

davidbz
Copy link

@davidbz davidbz commented Jan 30, 2018

By default allowHalfOpen should default to false (https://nodejs.org/api/net.html#net_new_net_socket_options)

@mscdex
Copy link
Owner

mscdex commented Jan 30, 2018

That may be true for creating a net.Socket, but it's not true for http.Server/https.Server, which (still) explicitly sets it to true in node core.

@davidbz
Copy link
Author

davidbz commented Jan 30, 2018

@mscdex thanks for your response. I'm running the following js code connecting to httpolyglot server and I end up getting CLOSE_WAIT connections. this is due to the fact that allowHalfOpen i set to true and there's no callback to end this connection. This does not happen on native node https server. any ideas? Thanks

`
const net = require('net');
const socket = new net.Socket();

socket.connect(9000, 'localhost', () => {
socket.end();
});
`

@davidbz davidbz closed this Jan 30, 2018
@davidbz davidbz deleted the allow_half_open_defaults branch January 30, 2018 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants