net: persist net.Socket options before connect
authorEvan Lucas <evanlucas@me.com>
Wed, 18 Feb 2015 18:02:01 +0000 (12:02 -0600)
committerEvan Lucas <evanlucas@me.com>
Tue, 19 May 2015 18:21:44 +0000 (13:21 -0500)
commit85d99830096a48b7d50cc3b0e5c3fba4172c2d02
tree758ca8abc3dc4107dcc4492e7b54f5c52b31c089
parent3c44100558b4e9e48e0e711e38acc91e0f870a9f
net: persist net.Socket options before connect

Remembers net.Socket options called before connect and retroactively
applies them after the handle has been created.

This change makes the following function calls more user-friendly:

- setKeepAlive()
- setNoDelay()
- ref()
- unref()

Related: https://github.com/joyent/node/issues/7077 and
https://github.com/joyent/node/issues/8572

Fixes: https://github.com/joyent/node/issues/7077
Fixes: https://github.com/joyent/node/issues/8572
PR-URL: https://github.com/nodejs/io.js/pull/1518
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Roman Reiss <me@silverwind.io>
lib/net.js
test/parallel/test-net-persistent-keepalive.js [new file with mode: 0644]
test/parallel/test-net-persistent-nodelay.js [new file with mode: 0644]
test/parallel/test-net-persistent-ref-unref.js [new file with mode: 0644]