X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FMyDiameterEntity.cpp;h=7bac08aaa2b6c1926749097abe3c05363d490ccc;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hp=6027bf0d526df2da86a3cdcd32ee26e7bd86ec18;hpb=d723d5bf571eb48c641b092058eaa38bb6c4fcc8;p=anna.git diff --git a/example/diameter/launcher/MyDiameterEntity.cpp b/example/diameter/launcher/MyDiameterEntity.cpp index 6027bf0..7bac08a 100644 --- a/example/diameter/launcher/MyDiameterEntity.cpp +++ b/example/diameter/launcher/MyDiameterEntity.cpp @@ -24,7 +24,7 @@ #include -void MyDiameterEntity::eventRequestRetransmission(const anna::diameter::comm::ClientSession* clientSession, anna::diameter::comm::Message *request) throw() { +void MyDiameterEntity::eventRequestRetransmission(const anna::diameter::comm::ClientSession* clientSession, anna::diameter::comm::Message *request) { LOGMETHOD(anna::TraceMethod tm("launcher::MyDiameterEntity", "eventRequestRetransmission", ANNA_FILE_LOCATION)); @@ -53,7 +53,7 @@ void MyDiameterEntity::eventRequestRetransmission(const anna::diameter::comm::Cl void MyDiameterEntity::eventRequest(anna::diameter::comm::ClientSession *clientSession, const anna::DataBlock &message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("launcher::MyDiameterEntity", "eventRequest", ANNA_FILE_LOCATION)); // Performance stats: Launcher& my_app = static_cast (anna::app::functions::getApp()); @@ -125,7 +125,7 @@ throw(anna::RuntimeException) { // Detailed log: if(my_node->logEnabled()) { anna::diameter::comm::ServerSession *usedServerSession = localServer->getLastUsedResource(); - std::string detail = usedServerSession ? usedServerSession->asString() : ""; // esto no deberia ocurrir + std::string detail = usedServerSession ? usedServerSession->asString() : "[null server session]"; // esto no deberia ocurrir my_node->writeLogFile(message, (success ? "fwd2c" : "fwd2cError"), detail); } } catch(anna::RuntimeException &ex) { @@ -134,11 +134,11 @@ throw(anna::RuntimeException) { } // Testing: - anna::testing::TestManager::instantiate().receiveMessage(message, clientSession); + anna::testing::TestManager::instantiate().receiveDiameterMessage(message, clientSession); } void MyDiameterEntity::eventResponse(const anna::diameter::comm::Response &response) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("launcher::MyDiameterEntity", "eventResponse", ANNA_FILE_LOCATION)); Launcher& my_app = static_cast (anna::app::functions::getApp()); anna::diameter::comm::OriginHost *my_node = my_app.getOriginHost(getEngine()->getOriginHostName()); @@ -147,8 +147,6 @@ throw(anna::RuntimeException) { anna::diameter::comm::Message* request = const_cast(response.getRequest()); const anna::DataBlock* message = response.getMessage(); const anna::diameter::comm::ClientSession *clientSession = static_cast(response.getSession()); - bool isBindResponse = (code == anna::diameter::comm::ClassCode::Bind); - bool isApplicationMessage = (code == anna::diameter::comm::ClassCode::ApplicationMessage); bool contextExpired = (result == anna::diameter::comm::Response::ResultCode::Timeout); bool isUnavailable = (result == anna::diameter::comm::Response::ResultCode::DiameterUnavailable); bool isOK = (result == anna::diameter::comm::Response::ResultCode::Success); @@ -210,7 +208,7 @@ throw(anna::RuntimeException) { // Detailed log: anna::diameter::comm::ServerSession *usedServerSession = my_node->getCommEngine()->findServerSession(request->getRequestServerSessionKey()); - std::string detail = usedServerSession ? usedServerSession->asString() : ""; // esto no deberia ocurrir + std::string detail = usedServerSession ? usedServerSession->asString() : "[null server session]"; // esto no deberia ocurrir if(my_node->logEnabled()) { my_node->writeLogFile(*message, (success ? "fwd2c" : "fwd2cError"), detail); @@ -229,11 +227,11 @@ throw(anna::RuntimeException) { if(isOK || contextExpired) my_node->sendBurstMessage(); // Testing: - if(isOK) anna::testing::TestManager::instantiate().receiveMessage(*message, clientSession); + if(isOK) anna::testing::TestManager::instantiate().receiveDiameterMessage(*message, clientSession); } void MyDiameterEntity::eventUnknownResponse(anna::diameter::comm::ClientSession *clientSession, const anna::DataBlock &message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("launcher::MyDiameterEntity", "eventUnknownResponse", ANNA_FILE_LOCATION)); // Performance stats: Launcher& my_app = static_cast (anna::app::functions::getApp()); @@ -256,7 +254,7 @@ throw(anna::RuntimeException) { } void MyDiameterEntity::eventDPA(anna::diameter::comm::ClientSession *clientSession, const anna::DataBlock &message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("launcher::MyDiameterEntity", "eventDPA", ANNA_FILE_LOCATION)); // Performance stats: Launcher& my_app = static_cast (anna::app::functions::getApp()); @@ -278,5 +276,5 @@ throw(anna::RuntimeException) { if(my_node->logEnabled()) my_node->writeLogFile(message, "recvfe", clientSession->asString()); // Testing: - anna::testing::TestManager::instantiate().receiveMessage(message, clientSession); + anna::testing::TestManager::instantiate().receiveDiameterMessage(message, clientSession); }