AgentX++: Subagent Reconnect does not work

christel.sohnemann____philips.com christel.sohnemann____philips.com
Tue Jul 3 17:11:56 CEST 2001


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____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