Closures & async node.js functions
问题 All, Trying to get my head around closures in a node.js context (async calls). I have the following code: timer = setInterval(pollOID, 1000); function pollOID() { for (channel in channels) { session.get({ oid: channels[channel].oid }, function (varbinds) { console.log("The " + channels[channel].name + " is " + varbinds); }); } } The code polls a router for SNMP data each second using a loop in the setInterval callback to query the router for several SNMP entities. The session.get function has