diff --git a/lib/net.js b/lib/net.js index 0577dd3c9fe0c7..7680c8860e1521 100644 --- a/lib/net.js +++ b/lib/net.js @@ -255,6 +255,8 @@ function Socket(options) { options.allowHalfOpen = true; // For backwards compat do not emit close on destroy. options.emitClose = false; + // Handle strings directly. + options.decodeStrings = false; stream.Duplex.call(this, options); // Default to *not* allowing half open sockets. @@ -308,9 +310,6 @@ function Socket(options) { this._pendingData = null; this._pendingEncoding = ''; - // handle strings directly - this._writableState.decodeStrings = false; - // If we have a handle, then start the flow of data into the // buffer. if not, then this will happen when we connect if (this._handle && options.readable !== false) {