|
|
@ -779,9 +779,11 @@ const messageBin = (env, chanName, msgBin, cb) => {
|
|
|
|
chan.writeStream.write(msgBin, function () {
|
|
|
|
chan.writeStream.write(msgBin, function () {
|
|
|
|
chan.onError.splice(chan.onError.indexOf(complete), 1);
|
|
|
|
chan.onError.splice(chan.onError.indexOf(complete), 1);
|
|
|
|
complete();
|
|
|
|
complete();
|
|
|
|
|
|
|
|
// It seems like this reintroduces a file descriptor leak
|
|
|
|
if (chan.onError.length) { return; }
|
|
|
|
if (chan.onError.length) { return; }
|
|
|
|
if (chan.delayClose && chan.delayClose.clear) {
|
|
|
|
if (chan.delayClose && chan.delayClose.clear) {
|
|
|
|
chan.delayClose.clear();
|
|
|
|
chan.delayClose.clear();
|
|
|
|
|
|
|
|
destroyStream(chan.writeStream, chanName);
|
|
|
|
delete env.channels[chanName];
|
|
|
|
delete env.channels[chanName];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|