X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FMyDiameterEntity.cpp;h=d16974b9e388daf07a3e1bddf725b5fee26b78c7;hb=84c30c372cf2926a138a6d51a52d56f3b2a63804;hp=702ec56c27621b5f1539710f2c8e17d7a53ff2bd;hpb=6f990d26c49e6f5bbb31cb1a2a47615918b6c339;p=anna.git diff --git a/example/diameter/launcher/MyDiameterEntity.cpp b/example/diameter/launcher/MyDiameterEntity.cpp index 702ec56..d16974b 100644 --- a/example/diameter/launcher/MyDiameterEntity.cpp +++ b/example/diameter/launcher/MyDiameterEntity.cpp @@ -17,6 +17,34 @@ #include "Launcher.hpp" +void MyDiameterEntity::eventRequestRetransmission(const anna::diameter::comm::ClientSession* clientSession, anna::diameter::comm::Message *request) throw() { + + LOGMETHOD(anna::TraceMethod tm("launcher::MyDiameterEntity", "eventRequestRetransmission", ANNA_FILE_LOCATION)); + + // Base class: + Entity::eventRequestRetransmission(clientSession, request); // warning trace + + // Performance stats: + Launcher& my_app = static_cast (anna::app::functions::getApp()); + CommandLine& cl(anna::CommandLine::instantiate()); + // CommandId: + anna::diameter::CommandId cid = anna::diameter::codec::functions::getCommandId(request->getBody()); + LOGDEBUG + ( + std::string msg = "Request retransmitted: "; + msg += anna::diameter::functions::commandIdAsPairString(cid); + msg += " | DiameterServer: "; + msg += anna::functions::socketLiteralAsString(clientSession->getAddress(), clientSession->getPort()); + msg += " | EventTime: "; + msg += anna::time::functions::currentTimeAsString(); + anna::Logger::debug(msg, ANNA_FILE_LOCATION); + ); + + // Write retransmission + if(my_app.logEnabled()) my_app.writeLogFile(request->getBody(), "retry", clientSession->asString(), a_codecEngine); +} + + void MyDiameterEntity::eventRequest(anna::diameter::comm::ClientSession *clientSession, const anna::DataBlock &message) throw(anna::RuntimeException) { LOGMETHOD(anna::TraceMethod tm("launcher::MyDiameterEntity", "eventRequest", ANNA_FILE_LOCATION)); @@ -78,7 +106,7 @@ throw(anna::RuntimeException) { if(localServer && (cid != anna::diameter::helpers::base::COMMANDID__Capabilities_Exchange_Request) /* don't forward CER */) { try { anna::diameter::comm::Message *msg = my_app.createCommMessage(); - msg->updateEndToEnd(false); // end-to-end will be kept + msg->forwardEndToEnd(); // end-to-end will be kept msg->setBody(message); msg->setRequestClientSessionKey(clientSession->getKey()); bool success = localServer->send(msg); @@ -159,7 +187,7 @@ throw(anna::RuntimeException) { if(localServer && (request_cid != anna::diameter::helpers::base::COMMANDID__Capabilities_Exchange_Request) /* don't forward CEA */) { try { anna::diameter::comm::Message *msg = my_app.createCommMessage(); - msg->updateEndToEnd(false); // end-to-end will be kept + msg->forwardEndToEnd(); // end-to-end will be kept msg->setBody(*message); bool success = localServer->send(msg, request->getRequestServerSessionKey()); my_app.releaseCommMessage(msg);