this.child.on("close", function () { debug("nmap process close output: %s", _this.rawData); process.removeListener('SIGINT', _this.killChild); process.removeListener('uncaughtException', _this.killChild); process.removeListener('exit', _this.killChild); if (_this.error) { _this.emit('error', _this.error); } if (_this.cancelled === true) { _this.emit('error', "Over scan timeout " + _this.scanTimeout); } else { _this.rawDataHandler(_this.rawData); } });