[AGENT++] (no subject)
Sharon Caspi
sharonc at scopus.net
Sun Nov 16 09:24:55 CET 2003
Hello.
I am using snmp++3.2.9a.
I am writing the next program (pseocode):
main()
{
//Creating two snmp objects
Snmp Snmp_Object1;
Snmp Snmp_Object2;
... Doing all required initializations:
//Registering for traps receiving:
Object1.notify_register(...);
Object2.notify_register(...);
}
The problem:
When I invoke : Object2.notify_register(...);
I fail.
I took a look at your code and I see that you try to open a socket (port 162 - the default one).
int CNotifyEventQueue::AddEntry(Snmp *snmp,
const OidCollection &trapids,
const TargetCollection &targets,
const AddressCollection &addresses)
you use m_msgCount member in order to decide whether the socket was already binded. But this is not work well
since it is not static.
I believe that your code will work properly if I will create only one instance of Snmp object.
More information about the AGENTPP
mailing list