スクリプトを開始しようとすると、エラーが発生し続けます。「check();」を呼び出す行を削除すると その後、正常に動作します。
エラー: node: ../src/node_io_watcher.cc:160: static v8::Handle node::IOWatcher::Set(const v8::Arguments&): アサーション `!io->watcher_.active' が失敗しました。
私は信じているバージョン6を使用しています。
失敗しているコードは以下のとおりです
function check(){
hosts.forEach(function(item) {
var sock = new net.Socket();
sock.setTimeout(7500);
ports.forEach(function(item1) {
sock.on('connect', function() {
console.log(item[0]+':'+item1[1]+' is up.');
sock.destroy();
serverstatus[item[1]][item1[0]] = "online";
}).on('error', function(e) {
console.log(item[0]+':'+item1[1]+' is down: ' + e.message);
serverstatus[item[1]][item1[0]] = "offline";
}).on('timeout', function(e) {
console.log(item[0]+':'+item1[1]+' is down: timeout');
serverstatus[item[1]][item1[0]] = "timeout";
}).connect(item1[1], item[0]);
});
});
}