[AGENT++] AgentX subagent: connection lost when signal arrives

Frank Fock fock at agentpp.com
Mon Sep 19 21:56:59 CEST 2005


Hi Rüdiger,

Thanks for the fix. It will be part of the next AgentX version
which is scheduled for release next week. That version will also
include other fixes posted here that might not have been commented
(Sorry).

SNMP++, AGENT++ and AgentX++Win32 will also be updated
soon.

Best regards,
Frank

Rüdiger Hinze wrote:

>Hi,
>
>I ran into a problem on Linux when using POSIX timers in an AgentX subagent: 
>every time a timer was released the connection to the master agent was lost. 
>The reason is that the select in AgentXSlave::receive doesn't handle 
>interrupts. For me, changing
>
>	if ((sel = select(FD_SETSIZE, &fdSet, NULL, NULL, tvptr)) < 0) {
>		LOG_BEGIN(ERROR_LOG | 1);
>		LOG("AgentXSlave: lost conncection with master");
>		LOG_END;
>		stopit = TRUE;
>		delete tvptr;
>		return 0; 
>	}
>	else if (sel == 0)  { ...
>
>to
>
>	if ((sel = select(FD_SETSIZE, &fdSet, NULL, NULL, tvptr)) < 0) {
>		if (errno == EINTR) {
>			LOG_BEGIN(ERROR_LOG | 5);
>			LOG("AgentXSlave: select interrupted");
>			LOG_END;
>			delete tvptr;
>			return 0; 
>		}
>		else
>		{
>			LOG_BEGIN(ERROR_LOG | 1);
>			LOG("AgentXSlave: lost conncection with master");
>			LOG_END;
>			stopit = TRUE;
>			delete tvptr;
>			return 0; 
>		}
>	}
>	else if (sel == 0)  { ...
>
>solved the problem. 
>
>
>Regards,
>
>  Ruediger Hinze
>_______________________________________________
>AGENTPP mailing list
>AGENTPP at agentpp.org
>http://lists.agentpp.org/mailman/listinfo/agentpp
>
>
>  
>


-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com





More information about the AGENTPP mailing list