[AGENT++] AgentX++ issue on embedded PPC (BigEndian)

Claus Klein claus.klein at arcormail.de
Thu Mar 31 22:01:12 CEST 2011


Hello,

While working on an embedded PPC device with agentX++,

I had to change the following code.

I have 2 question about this responsePool, which is a ThreadPool with  
size 1.

Why is only a 1 Thread at this Pool used?
And why is the pool deleted every time after connection problems?

SubAgentXMib::init()
{
	init_response_pool();	// create new ThreadPool every time?

	// (re)initialize AgentX protocol
	agentx->reinit();
	// load persistent objects
	Mib::init();
...
}

Claus

=== modified file 'agentX++/src/agentx_pdu.cpp'
--- old/agentX++/src/agentx_pdu.cpp	2010-10-31 08:30:19 +0000
+++ new/agentX++/src/agentx_pdu.cpp	2011-03-31 17:22:58 +0000
@@ -32,6 +32,12 @@
  namespace Agentpp {
  #endif

+#if (BYTE_ORDER == LITTLE_ENDIAN)
+#undef WORDS_BIGENDIAN
+#else
+#define WORDS_BIGENDIAN
+#endif
+
  /**
   * AgentXOctets
   */

=== modified file 'agentX++/src/agentx_subagent.cpp'
--- old/agentX++/src/agentx_subagent.cpp	2010-11-05 12:06:56 +0000
+++ new/agentX++/src/agentx_subagent.cpp	2011-03-31 04:54:24 +0000
@@ -32,6 +32,10 @@
  namespace Agentpp {
  #endif

+#ifdef _THREADS
+#undef _THREADS
+#warning "_THREADS disabled, responsePool not used!"
+#endif

  class AgentXReconnect: public Runnable {
  public:
@@ -511,7 +515,7 @@
  {
  #ifdef _THREADS
  	if (responsePool) {
-		delete responsePool;
+		delete responsePool;	// FIXME prevent delete of this Pool while  
connection problems
  	}
  	responsePool = new QueuedThreadPool(1);
  	responsePool->start();




More information about the AGENTPP mailing list