On Mon, Apr 18, 2005 at 01:43:37PM +0100, Dave Shield wrote:
> On Thu, 2005-04-14 at 22:25, Robert Story wrote:
> > Doesn't setting SNMP_FLAGS_DONT_PROBE in the session flags work? That should
> > prevent the probe and allow a valid session struct to be returned.
> 
> Possibly, but it still feels like an unnecessary step.
> 
> With the old v4 distributions (and even with v5, given a configure
> choice of SNMPv1 or SNMPv2c as the default version), then
> 
>       snmp_sess_init( &sess );
>       ss1 = snmp_open( &sess );
>       ss2 = snmp_open( &sess );

so this seems to be the real answer to my question on -users..
this gives a case for not using the single session API (you used
snmp_open rather than snmp_sess_open)

> [I can't believe that I'm arguing to change this, having already
>  documented this behaviour in the client-side programming chapter!]

Where can I read this chapter? It looks promising:  Sure I can look
at the tutorial, but I could recode each tutorial using functions
out of snmp_client.h rather than snmp_api.h, single session API
rather than the plain snmp_open, snmp_parse_pdu rather than read_objid
etc. but there doesn't seem to be anywhere which says something
like "Unless you are really writing a multithreaded application,
steer clear of snmp_sess_open and stick to snmp_open" i.e., style
recommendations / what is the actual API as opposed to a function
found under the bonnet / what the intended use of the functions
is... Hopefully I'm missing something and could can say "just read
<url>" :-)

Cheers,

Patrick


-------------------------------------------------------
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://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to