-1
arp.stdout.pipe(parse).pipe(filter).pipe(through(function(device) {
this.queue(device.mac + '\n');
device_d.push(device.mac);
}));
function CreateList() {
arp.stdout.pipe(parse).pipe(filter).pipe(through(function(device) {
this.queue(device.mac + '\n');
device_d.push(device.mac);
}));
setTimeout(function() {
return device_d;
}, 1000);
}
返回之前是没有得到执行这段代码运行功能同步。我总是得到一个空阵列。 我会得到只有在
arp.stdout.pipe(parse).pipe(filter).pipe(through(function(device)
//{this.queue(device.mac + '\n');device_d.push(device.mac);})); runs synchronously.
你究竟在问什么? – MrHug
这是一个问题或答案? – Technotronic