Should my set handler be hit multiple times?

Andrew Agno <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <CAKwLKVCX8ag7MV2R29ppu9-qPa512R=2KiNvEztdpdtSOZw0TA@mail.gmail.com>
Hi,

I'm running some tests with a simple example program that I've generated
via mib2c, and filled in.  To test it, I'm running snmpset to set a value
for a Gauge32.  This works, but sometimes, my handler gets called twice,
despite the fact that I've only made one request.

In particular, having my code log whenever MODE_SET_COMMIT is called, I see
that it gets called twice.  Is this expected behavior?  The FAQ mentions
this can happen with get next/first, but not on setting a value.

One thing that I have noticed is that I can only reproduce this if I have
an event loop that pauses for a long time (using sleep(1), for example):

  while(keep_running) {
    while(agent_check_and_process(0) > 0) ; // need to call this in a loop
or things don't work
    sleep(1);
  }

Removing the sleep(1), as if there was nothing else happening, allows it to
work (though it naturally uses as much CPU as it can in that case).

Thanks,
Andrew.

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.