diff --git a/index.js b/index.js index dfb2a56..08b82bc 100644 --- a/index.js +++ b/index.js @@ -263,6 +263,7 @@ module.exports = class Protomux { this._notify = new Map() this.stream.on('data', this._ondata.bind(this)) + this.stream.on('end', this._onend.bind(this)) this.stream.on('error', noop) // we handle this in "close" this.stream.on('close', this._shutdown.bind(this)) } @@ -393,6 +394,10 @@ module.exports = class Protomux { } } + _onend () { // TODO: support half open mode for the users who wants that here + this.stream.end() + } + _decode (remoteId, state) { const type = c.uint.decode(state)