On Tue, 2011-11-22 at 12:35 +0530, [email protected] wrote:
> Hi, 
> 
> Thanks for answering my previous questions. Now please help me solve a
> problem I am facing. 
> 
> I have created an application that will query a network device every
> 10 sec.
> 
> And my app will also sent some critical info to a network server in
> every 200 milliseconds.
> 
> A loop-timer mechanism will take care of this, if no functions are
> blocking calls. 
> 
> So I have used “snmp_async_send” API to query the device, so that it
> will not block my application flow.
> 
> And everything worked fine, for some time. 
> 
> But recently I have found that when the n/w device to be queried, is
> powered off; this API will block my application flow for some 2 sec,
> and returns a timeout error.

How do you refer to the device. What system call is it that blocks? Is
it the send that will transmit data to your device or is it something
else?

I have a bad feeling that it isn't the "send" operation that blocks for
you but rather something else so, please, provide some more data, like
e.g. a strace of your application when running.

> But by this time the window for sending the critical info to the
> server will be over.
> 
> So my app fails.. 
> 
> The waiting for timeout may be causing this problem.
> 
> Is there any way to make this function (snmp_async_send) truly
> asynchronous?
> 
> That means, is it possible to make this function to just send the PDU
> and return, and to capture the error in the response callback?
>
> I think somebody has also asked this question, but it remains
> unanswered.
> 
>  
> 
> And I would like to know whether there is a command known as TEST,
> which is to be used before SNMPSET.
> 
> Somebody told me, it is better to issue a TEST before a SET.
> 
> If true,  can you point me to any tutorials/references for that.

Internally an snmp agent should handle all set requests as atomic
operations. This is often accomplished using a two-phase commit protocol
and then TESTSET is used to ask the object that is to be updated if it
can accept a given new value.

The end of this is that you, as a management station, doesn't have to
care about it. 

/MF



------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to