[AGENT++] Problem with trap receive...

Fedja Jeleskovic mrawd2 at gmail.com
Mon Jan 10 18:15:06 CET 2005


> >>for all async action you have to call SNMPProcessPendingEvents() or
> >>SNMPProcessEvents() in a loop. snmp++ does not have an internal thread
> >>that does this.
> >
> > Are there any plans to add this feature into the snmp++ in the near
future?
> > I mean running an extra thread for this shouldn't be that much of an
issue,
> > but I might be missing something bigger. Any more info on this?
>
> it's difficult to add this for all usages of Snmp class: What should the
> object do:
> - create a poll thread in constructor and stop it in destructor
> - create a thread only when it's necessary: if the user wants to listen
> for notifications and if an async response is outstanding.
>
> Depending on the applications both can be good or bad.
>
> Maybe two member functions start_poll_thread(const int select_timeout)
> and stop_poll_thread() will be the best option.

Well, at lest start_pool_thread() would be needed. With a flag set in there,
the destructor would know that thread is running, so it would close it when
called. The thing is it is not that difficult to implement it on the side,
but it would be easier to deal with this if the member would exist. I have
already done that, so if you want the code, let me know.

Thanks


Fedja




More information about the AGENTPP mailing list