On Thu, 25 Nov 2004 11:19:48 +0100 (MET) Sven wrote: SJ> I would like to send in a loop over 20000-Requests. First, in this loop i SJ> create a pdu with snmp_pdu_create(SNMP_MSG_SET). Than i add about 10 SJ> Variables to this pdu with snmp_pdu_add_variable. After that, i call SJ> snmp_synch_response. SJ> SJ> I a first test, this seems to work. SJ> SJ> The question now is, do i have to call snmp_sess_init, snmp_open, SJ> snmp_free_pdu and snmp_close in my loop, too?
No, you can re-use a single session for all the requests. You'll just have to set the peername in the session every time you change the agent you want to talk to. SJ> Or will snmp_pdu_create(SNMP_MSG_SET) allocate enough memory for the SJ> request. Does anybody know, whether this could cause some memory-bugs? I don't understand the question here. If you want to send the exact same request, then create it once (outside of the loop) and duplicate it inside the loop. This is necessary because on a successful send, the library will free the pdu. -- Robert Story; NET-SNMP Junkie Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp> Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders> You are lost in a twisty maze of little standards, all different. ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Net-snmp-coders mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
