X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=source%2Fdiameter.comm%2FClientSession.cpp;fp=source%2Fdiameter.comm%2FClientSession.cpp;h=fa4a9c3b3661a166bdb8832f832a0b826cb062a5;hp=c624155dd37ee0920a6416ece7bd9de790c80216;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hpb=af9c86ffb0e28d35ad94d99c5f77e41578c972b4 diff --git a/source/diameter.comm/ClientSession.cpp b/source/diameter.comm/ClientSession.cpp index c624155..fa4a9c3 100644 --- a/source/diameter.comm/ClientSession.cpp +++ b/source/diameter.comm/ClientSession.cpp @@ -57,7 +57,7 @@ ClientSession::ClientSession() : Session("diameter::comm::ClientSession", "Diame { initialize(); } -void ClientSession::initialize() throw() { +void ClientSession::initialize() { Session::initialize(); a_autoRecovery = true; a_parent = NULL; @@ -69,22 +69,22 @@ void ClientSession::initialize() throw() { //ClientSession::~ClientSession() {;} -const std::string& ClientSession::getAddress() const throw() { +const std::string& ClientSession::getAddress() const { return a_parent->getAddress(); } -int ClientSession::getPort() const throw() { +int ClientSession::getPort() const { return a_parent->getPort(); } -void ClientSession::setState(State::_v state) throw() { +void ClientSession::setState(State::_v state) { Session::setState(state); // Inform father server (availability changes): a_parent->refreshAvailability(); } -void ClientSession::bind() throw(anna::RuntimeException) { +void ClientSession::bind() noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "bind", ANNA_FILE_LOCATION)); if(a_state != State::Closed) @@ -125,7 +125,7 @@ void ClientSession::bind() throw(anna::RuntimeException) { } -void ClientSession::setCERandDWR(const anna::DataBlock & cer, const anna::DataBlock & dwr) throw(anna::RuntimeException) { +void ClientSession::setCERandDWR(const anna::DataBlock & cer, const anna::DataBlock & dwr) noexcept(false) { if(codec::functions::getCommandId(cer) != helpers::base::COMMANDID__Capabilities_Exchange_Request) { throw anna::RuntimeException("The message provided as 'CER' is not a Capabilities-Exchange-Request", ANNA_FILE_LOCATION); } @@ -144,7 +144,7 @@ void ClientSession::setCERandDWR(const anna::DataBlock & cer, const anna::DataBl } -const Response* ClientSession::send(const Message* message) throw(anna::RuntimeException) { +const Response* ClientSession::send(const Message* message) noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "send", ANNA_FILE_LOCATION)); if(!message) @@ -356,7 +356,7 @@ const Response* ClientSession::send(const Message* message) throw(anna::RuntimeE } bool ClientSession::unbind(bool forceDisconnect) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "unbind", ANNA_FILE_LOCATION)); if(a_state == State::Closed) @@ -442,12 +442,12 @@ throw(anna::RuntimeException) { return false; } -void ClientSession::eventPeerShutdown() throw() { +void ClientSession::eventPeerShutdown() { // Inform father server: a_parent->eventPeerShutdown(this); } -void ClientSession::eventRequestRetransmission(Message *request) throw() { +void ClientSession::eventRequestRetransmission(Message *request) { // OAM OamModule &oamModule = OamModule::instantiate(); @@ -458,22 +458,22 @@ void ClientSession::eventRequestRetransmission(Message *request) throw() { a_parent->eventRequestRetransmission(this, request); } -void ClientSession::eventResponse(const Response& response) throw(anna::RuntimeException) { +void ClientSession::eventResponse(const Response& response) noexcept(false) { // Inform father server: a_parent->eventResponse(response); } -void ClientSession::eventRequest(const anna::DataBlock &request) throw(anna::RuntimeException) { +void ClientSession::eventRequest(const anna::DataBlock &request) noexcept(false) { // Inform father server: a_parent->eventRequest(this, request); } -void ClientSession::eventUnknownResponse(const anna::DataBlock& response) throw(anna::RuntimeException) { +void ClientSession::eventUnknownResponse(const anna::DataBlock& response) noexcept(false) { // Inform father server: a_parent->eventUnknownResponse(this, response); } -void ClientSession::eventDPA(const anna::DataBlock& response) throw(anna::RuntimeException) { +void ClientSession::eventDPA(const anna::DataBlock& response) noexcept(false) { // Inform father server: a_parent->eventDPA(this, response); } @@ -484,7 +484,7 @@ void ClientSession::eventDPA(const anna::DataBlock& response) throw(anna::Runtim // Se invoca desde el diameter::comm::Receiver //------------------------------------------------------------------------------------------ void ClientSession::receive(const anna::comm::Message& message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "receive", ANNA_FILE_LOCATION)); // Activity: updateIncomingActivityTime(); @@ -729,7 +729,7 @@ throw(anna::RuntimeException) { unbind(immediateUnbind); } -void ClientSession::finalize() throw() { +void ClientSession::finalize() { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "finalize", ANNA_FILE_LOCATION)); Session::finalize(); // Inform father server (availability changes): @@ -749,7 +749,7 @@ void ClientSession::finalize() throw() { } } -void ClientSession::recover() throw() { +void ClientSession::recover() { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "recover", ANNA_FILE_LOCATION)); try { @@ -781,7 +781,7 @@ void ClientSession::recover() throw() { } void ClientSession::sendDWAToServer(const anna::DataBlock& dwrDB) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "sendDWAToServer", ANNA_FILE_LOCATION)); anna::DataBlock dwa(true); a_engine->readDWA(dwa, dwrDB); // Asume that DWA is valid ... @@ -798,7 +798,7 @@ throw(anna::RuntimeException) { // Se invoca desde diameter::comm::Timer //------------------------------------------------------------------------- void ClientSession::expireResponse(diameter::comm::Response* response) -throw() { +{ LOGMETHOD(anna::TraceMethod traceMethod(a_className, "expireResponse", ANNA_FILE_LOCATION)); Session::expireResponse(response); // OAM @@ -821,7 +821,7 @@ throw() { std::string ClientSession::asString() const -throw() { +{ string result = Session::asString(); result += " | Parent Server: "; result += anna::functions::socketLiteralAsString(getAddress(), getPort()); @@ -844,7 +844,7 @@ throw() { } anna::xml::Node* ClientSession::asXML(anna::xml::Node* parent) const -throw() { +{ anna::xml::Node* result = Session::asXML(parent); parent->createChild("diameter.comm.ClientSession"); result->createAttribute("ParentServer", anna::functions::socketLiteralAsString(getAddress(), getPort())); @@ -861,7 +861,7 @@ throw() { const char* ClientSession::asText(const WatchdogState::_v watchdogState) -throw() { +{ static const char* text [] = { "TimerStopped", "WaitingTimerExpiration", "WaitingDWA" }; return text [watchdogState]; } @@ -870,7 +870,7 @@ throw() { //------------------------------------------------------------------------------ //------------------------------------------------------ ClientSession::expire() //------------------------------------------------------------------------------ -void ClientSession::expire(anna::timex::Engine *timeController) throw(anna::RuntimeException) { +void ClientSession::expire(anna::timex::Engine *timeController) noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "expire (watchdog timer)", ANNA_FILE_LOCATION)); // The client MUST NOT close the primary connection until the @@ -907,11 +907,11 @@ void ClientSession::expire(anna::timex::Engine *timeController) throw(anna::Runt activateTimer(); } -void ClientSession::setWatchdogPeriod(const anna::Millisecond & watchdogPeriod) throw() { +void ClientSession::setWatchdogPeriod(const anna::Millisecond & watchdogPeriod) { setTimeout(watchdogPeriod); } -void ClientSession::setWatchdogState(WatchdogState::_v wState) throw() { +void ClientSession::setWatchdogState(WatchdogState::_v wState) { LOGDEBUG( if(wState != a_watchdogState) { @@ -926,12 +926,12 @@ void ClientSession::setWatchdogState(WatchdogState::_v wState) throw() { } -void ClientSession::timerStopped() throw() { +void ClientSession::timerStopped() { LOGDEBUG(anna::Logger::debug("Watchdog timer stopped", ANNA_FILE_LOCATION)); setWatchdogState(WatchdogState::TimerStopped); } -void ClientSession::timerStarted() throw() { +void ClientSession::timerStarted() { LOGDEBUG(anna::Logger::debug("Watchdog timer started", ANNA_FILE_LOCATION)); if(a_watchdogState == WatchdogState::WaitingDWA) return; @@ -943,7 +943,7 @@ void ClientSession::timerStarted() throw() { //------------------------------------------------------------------------------ //---------------------------------- ClientSession::updateIncomingActivityTime() //------------------------------------------------------------------------------ -void ClientSession::updateIncomingActivityTime() throw() { +void ClientSession::updateIncomingActivityTime() { Session::updateIncomingActivityTime(); a_parent->updateIncomingActivityTime(); } @@ -952,7 +952,7 @@ void ClientSession::updateIncomingActivityTime() throw() { //------------------------------------------------------------------------------ //---------------------------------- ClientSession::updateOutgoingActivityTime() //------------------------------------------------------------------------------ -void ClientSession::updateOutgoingActivityTime(void) throw() { +void ClientSession::updateOutgoingActivityTime(void) { Session::updateOutgoingActivityTime(); a_parent->updateOutgoingActivityTime(); } @@ -962,7 +962,7 @@ void ClientSession::updateOutgoingActivityTime(void) throw() { //------------------------------------------------------------------------------ //----------------------------------------------- ClientSession::countSendings() //------------------------------------------------------------------------------ -void ClientSession::countSendings(const diameter::CommandId & cid, unsigned int aid, bool ok)throw() { +void ClientSession::countSendings(const diameter::CommandId & cid, unsigned int aid, bool ok){ OamModule &oamModule = OamModule::instantiate(); ApplicationMessageOamModule &appMsgOamModule = ApplicationMessageOamModule::instantiate();