Hard refactoring. CodecEngine is associated to a unique stack.
[anna.git] / example / diameter / launcher / MyDiameterEntity.cpp
index 50a9663..6c1244b 100644 (file)
@@ -101,9 +101,6 @@ throw(anna::RuntimeException) {
   Launcher& my_app = static_cast <Launcher&>(anna::app::functions::getApp());
   RealmNode * my_node = my_app.getRealmNode(getEngine()->getRealm());
 
-  // Testing:
-  TestManager::instantiate().receiveMessage(message, clientSession);
-
   // CommandId:
   anna::diameter::CommandId cid = anna::diameter::codec::functions::getCommandId(message);
   LOGDEBUG
@@ -177,6 +174,9 @@ throw(anna::RuntimeException) {
       ex.trace();
     }
   }
+
+  // Testing:
+  TestManager::instantiate().receiveMessage(message, my_node, clientSession);
 }
 
 void MyDiameterEntity::eventResponse(const anna::diameter::comm::Response &response)
@@ -195,9 +195,6 @@ throw(anna::RuntimeException) {
   bool isUnavailable = (result == anna::diameter::comm::Response::ResultCode::DiameterUnavailable);
   bool isOK = (result == anna::diameter::comm::Response::ResultCode::Success);
 
-  // Testing:
-  TestManager::instantiate().receiveMessage(*message, clientSession);
-
   // CommandId:
   anna::diameter::CommandId request_cid = request->getCommandId();
   LOGDEBUG
@@ -272,6 +269,9 @@ throw(anna::RuntimeException) {
 
   // Triggering burst:
   if(isOK || contextExpired) my_node->sendBurstMessage();
+
+  // Testing:
+  TestManager::instantiate().receiveMessage(*message, my_node, clientSession);
 }
 
 void MyDiameterEntity::eventUnknownResponse(anna::diameter::comm::ClientSession *clientSession, const anna::DataBlock &message)