When to close a SNMP session when using multiple sessions

chiel <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi all,

I'm writing a Perl script with some basic SNMP functions. I only wonder
when I need to close a session when I have multiple SNMP sessions, after
each session or after all of them?
For example:

my $resultat1 =  $session->get_table(Baseoid => $cisco_fan);
$session->close();
my $resultat2 =  $session->get_table(Baseoid => $cisco_power);
$session->close();

Or:

my $resultat1 =  $session->get_table(Baseoid => $cisco_fan);
my $resultat2 =  $session->get_table(Baseoid => $cisco_power);
$session->close();

I think the first is the correct way. But what are the consequences of
using the second?

Regards,
chiel

------------------------------------------------------------------------------
This SF Dev2Dev email is sponsored by:

WikiLeaks The End of the Free Internet
http://p.sf.net/sfu/therealnews-com
_______________________________________________
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.