summaryrefslogtreecommitdiff
path: root/lib/net.js
diff options
context:
space:
mode:
authorbentaber <ben.taber@gmail.com>2012-12-27 07:57:19 -0700
committerisaacs <i@izs.me>2012-12-27 17:53:28 -0800
commite576208eba9c0b343b9c1510be0839282fa1aff5 (patch)
tree6b34ba9f6a715dcd3acaab9b67cefaa4ed3255a5 /lib/net.js
parentfde338bf83bdc7c0524734bb03f374e90dcd1cf1 (diff)
downloadandroid-node-v8-e576208eba9c0b343b9c1510be0839282fa1aff5.tar.gz
android-node-v8-e576208eba9c0b343b9c1510be0839282fa1aff5.tar.bz2
android-node-v8-e576208eba9c0b343b9c1510be0839282fa1aff5.zip
net: socket.readyState corrections
socket.readyState, .readable, and .writable behavior changed as a result of the new streaming interfaces. Updated to be backwards compatible with current API and adds regression test. closes #4461
Diffstat (limited to 'lib/net.js')
-rw-r--r--lib/net.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/net.js b/lib/net.js
index e0bbef64e8..5df47a0a36 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -136,13 +136,13 @@ function Socket(options) {
break;
}
+ stream.Duplex.call(this, options);
this.readable = this.writable = false;
+
if (options.handle) {
this._handle = options.handle; // private
} else if (typeof options.fd === 'undefined') {
this._handle = options && options.handle; // private
- this.readable = options.readable !== false;
- this.writable = options.writable !== false;
} else {
this._handle = createPipe();
this._handle.open(options.fd);
@@ -160,8 +160,6 @@ function Socket(options) {
this._pendingWrite = null;
- stream.Duplex.call(this, options);
-
// handle strings directly
this._writableState.decodeStrings = false;