|
|
@ -117,11 +117,6 @@ function setupChannel(target, channel) { |
|
|
|
|
|
|
|
if (!target._channel) throw new Error("channel closed"); |
|
|
|
|
|
|
|
// For overflow protection don't write if channel queue is too deep.
|
|
|
|
if (channel.writeQueueSize > 1024 * 1024) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
var buffer = Buffer(JSON.stringify(message) + '\n'); |
|
|
|
|
|
|
|
if (sendHandle && setSimultaneousAccepts) { |
|
|
@ -137,7 +132,8 @@ function setupChannel(target, channel) { |
|
|
|
|
|
|
|
writeReq.oncomplete = nop; |
|
|
|
|
|
|
|
return true; |
|
|
|
/* If the master is > 2 read() calls behind, please stop sending. */ |
|
|
|
return channel.writeQueueSize < (65536 * 2); |
|
|
|
}; |
|
|
|
|
|
|
|
channel.readStart(); |
|
|
|