AgentX++: Subagent Reconnect does not work
Frank Fock
Frank.Fock____t-online.de
Thu Jul 5 09:21:51 CEST 2001
Hi Christel,
The reconnect does currently not properly work. This will be fixed soon
with a AgentX++v1.3 which will be released together with
AGENT++v3.4.7.
With a few modifications, you can get the current code work as well:
1. Insert "stopit = TRUE" within AgentXSlave::receive whereever
connection loss is detected. Remove the "raise(SIGTERM)" and
set the error level of the LOG_BEGIN statement to 1.
2. Change "void Mib::init()" to "boolean Mib::init()". This must be
changed in MasterAgentXMib and SubAgentXMib accordingly.
The new init() method should return TRUE if initialization (reconnection)
was successful.
Hope this helps?
Best regards,
Frank
christel.sohnemann____philips.com wrote:
> Hi everybody,
> I have the following run-loop in a thread, which is a AgentX++ subagent:
>
> do
> {
> while( (! m_pMib->get_agentx()->quit()) && (! m_bStopped ) )
> {
> pRequest = m_pReqList->receive(m_uiListenerTimeout);
> if( pRequest )
> {
> m_pMib->process_request(pRequest);
> }
> else
> {
> m_pMib->ping_master();
> }
>
> }
>
> if ( ! m_bStopped )
> {
> Sleep(m_uiListenerTimeout);
> m_pMib->save_all(); // saves persistent MIB objects to disk
> initMib(); // reestablish connection with master
> // and load MIB objects from disk
> }
> } while (m_bAutoRestart && (! m_bStopped ) );
>
> m_bStop is a bool flag to terminate the Thread from outside, m_bAutoRestart is a flag to configure the
> subagent whether it should automatically restart or not. It is set to true.
>
> What I find out is, that the inner while loop never terminates, even if I stop the master agent. The "quit" method returns the "stopit"
> member of the class, but it is always true. I followed your example about the restart-mechanism, so what's wrong with it?
> Is there no such thing as reestablishing the master & subagent connection? How can the subagent find out, that it's master
> has died if not in this way?
>
> Best regards,
> Christel
>
> Christel Sohnemann
> Software Development
> Philips Speech Processing Aachen, Zweigniederlassung der Philips GmbH
> Kackertstr. 10, 52072 Aachen, Germany
> mailTo: christel.sohnemann at philips.com
> Tel: +49 - (0)241 - 8871 191, Fax: +49 - (0)241 - 8871 140
> http://www.speech.philips.com/
More information about the AGENTPP
mailing list