Skip to content

Comments

By default allowHalfOpen should be false#10

Closed
davidbz wants to merge 1 commit intomscdex:masterfrom
davidbz:allow_half_open_defaults
Closed

By default allowHalfOpen should be false#10
davidbz wants to merge 1 commit intomscdex:masterfrom
davidbz:allow_half_open_defaults

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