Answer the question
In order to leave comments, you need to log in
Is it possible to make node work asynchronous in this case?
on a post request, the script accesses the piece of iron via snmp and returns its response.
app.post('/checkHw',function(req,res){
var ip=req.body.ip;
обращение по ip;
ответ в response;
}
Answer the question
In order to leave comments, you need to log in
If you pull net-snmp through a shell script, then child_process.exec (see https://nodejs.org/api/child_process.html#child_pr... asynchronous. I assume that this works through popen, although most likely it has its own wrapper, in order not to suffer with crookedly implemented popen.If
in general net-snmp directly from the same process, for example through the C API, then it's better not to do this :D
If snmp is a pure nodejs module, then it is 100% (ok - 99%) asynchronous. Don't like callback hell - then promises or generators.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question