[AGENT++] Can somebody explain the subagent reconnection mechanism?

Frank Fock fock at agentpp.com
Fri Feb 13 00:41:26 CET 2004


Hi Andreas,

Andreas Vinsander wrote:

> Hi!
> Reading the docs for agentX++ I found the following:
> -----------<snip>
> MIB initialization can be done likewise to AGENT++. The 
> SubAgentXMib::init() method
> loads any persistent data from disk and then opens the connection to 
> the master agent.
> In contrast to Mib::init() it may thus return FALSE if the connection 
> could not have been
> established. This behavior can be used to implement a subagent that 
> tries to reconnect
> to its master agent once a connection got broken. A prerequisite for 
> this is that the
> SIGTERM signal is handled but ignored by the subagent.
> -----------<end snip>
>
> Is this true? Should a library really use signals to communicate events?
>
No. The last sentence from the quoted text above is no longer true. I 
will remove
it from the documentation. I apologize for having you mislead by this 
outddated
information.

> We are right now trying to decide what agentX library to use in an 
> application built upon an existing framework (signalhandlers are used 
> way down in that framework to capture and act upon signals from the 
> surrounding, SIGTERM is treated as an attempt to stop the 
> application). Reading the statement above I would say agentX++ is not 
> suited for us, correct?
>
No.

> Are there other ways to handle reconnection attempts towards the 
> master agent from an application using agentX++?
>
Just have a look at the subagent2 example which shows how it is done.
You can comment out the line where a SIGTERM handler is registered
and the reconnect still works.

Best regards,
Frank





More information about the AGENTPP mailing list