@ -69,7 +69,7 @@ const handleConversion = {
// the slave should keep track of the socket
message . key = socket . server . _ connectionKey ;
var firstTime = ! this . _ channel . sockets . send [ message . key ] ;
var firstTime = ! this . channel . sockets . send [ message . key ] ;
var socketList = getSocketList ( 'send' , this , message . key ) ;
// the server should no longer expose a .connection property
@ -409,7 +409,15 @@ ChildProcess.prototype.unref = function() {
function setupChannel ( target , channel ) {
target . _ channel = channel ;
target . channel = channel ;
// _channel can be deprecated in version 8
Object . defineProperty ( target , '_channel' , {
get ( ) { return target . channel ; } ,
set ( val ) { target . channel = val ; } ,
enumerable : true
} ) ;
target . _ handleQueue = null ;
target . _ pendingHandle = null ;
@ -465,7 +473,7 @@ function setupChannel(target, channel) {
target . disconnect ( ) ;
channel . onread = nop ;
channel . close ( ) ;
target . _ channel = null ;
target . channel = null ;
maybeClose ( target ) ;
}
} ;
@ -491,7 +499,7 @@ function setupChannel(target, channel) {
} ) ;
// Process a pending disconnect (if any).
if ( ! target . connected && target . _ channel && ! target . _ handleQueue )
if ( ! target . connected && target . channel && ! target . _ handleQueue )
target . _ disconnect ( ) ;
return ;
@ -547,7 +555,7 @@ function setupChannel(target, channel) {
} ;
target . _ send = function ( message , handle , options , callback ) {
assert ( this . connected || this . _ channel ) ;
assert ( this . connected || this . channel ) ;
if ( message === undefined )
throw new TypeError ( '"message" argument cannot be undefined' ) ;
@ -667,11 +675,11 @@ function setupChannel(target, channel) {
// connected will be set to false immediately when a disconnect() is
// requested, even though the channel might still be alive internally to
// process queued messages. The three states are distinguished as follows:
// - disconnect() never requested: _ channel is not null and connected
// - disconnect() never requested: channel is not null and connected
// is true
// - disconnect() requested, messages in the queue: _ channel is not null
// - disconnect() requested, messages in the queue: channel is not null
// and connected is false
// - disconnect() requested, channel actually disconnected: _ channel is
// - disconnect() requested, channel actually disconnected: channel is
// null and connected is false
target . connected = true ;
@ -692,10 +700,10 @@ function setupChannel(target, channel) {
} ;
target . _ disconnect = function ( ) {
assert ( this . _ channel ) ;
assert ( this . channel ) ;
// This marks the fact that the channel is actually disconnected.
this . _ channel = null ;
this . channel = null ;
if ( this . _ pendingHandle ) {
this . _ pendingHandle . close ( ) ;
@ -729,7 +737,7 @@ function setupChannel(target, channel) {
const INTERNAL_PREFIX = 'NODE_' ;
function handleMessage ( target , message , handle ) {
if ( ! target . _ channel )
if ( ! target . channel )
return ;
var eventName = 'message' ;
@ -860,7 +868,7 @@ function _validateStdio(stdio, sync) {
function getSocketList ( type , slave , key ) {
var sockets = slave . _ channel . sockets [ type ] ;
var sockets = slave . channel . sockets [ type ] ;
var socketList = sockets [ key ] ;
if ( ! socketList ) {
var Construct = type === 'send' ? SocketListSend : SocketListReceive ;