Hello,

I tried to run the code at 
http://net-snmp.sourceforge.net/wiki/index.php/TUT:Simple_Application 
repeatedly inside a function, as well as the main() of snmpget.c also as a 
function call.

The problem is that it keeps opening sessions and never closes them.

The following call in snmp_client.c inside snmp_synch_response_cb()

count = select(numfds, &fdset, NULL, NULL, tvp);

crashes after a number of iterations because "numfds" keeps growing. It keeps 
growing because of

*numfds = (slp->transport->sock + 1);

inside snmp_sess_select_info2_flags() in snmp_api.c

I can't have as many sockets as I like in my platform, therefore it only works 
up to a point then crashes.

It looks like the global variable

struct session_list *Sessions = NULL;   /* MT_LIB_SESSION */

is filled but never emptied. How do I do that?

After six calls:

((*((*(Sessions)).session)).sessid) = 6

((*((*(Sessions)).transport)).sock) = 5

I don't want N sessions and N sockets. I want to destroy the session as soon as 
I'm done with it and create a new one again on the second call.

Thank you very much for your support

MF
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to