X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=include%2Fanna%2Fdiameter.comm%2FClientSession.hpp;fp=include%2Fanna%2Fdiameter.comm%2FClientSession.hpp;h=f653ee59bef5d428fdb6a1b73f70ce4d1bf5ec66;hp=0b4b437beca6ae9a9e3fd07abb42c5723cb3b1f9;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hpb=af9c86ffb0e28d35ad94d99c5f77e41578c972b4 diff --git a/include/anna/diameter.comm/ClientSession.hpp b/include/anna/diameter.comm/ClientSession.hpp index 0b4b437..f653ee5 100644 --- a/include/anna/diameter.comm/ClientSession.hpp +++ b/include/anna/diameter.comm/ClientSession.hpp @@ -51,7 +51,7 @@ class Server; class ClientSession : public Session { // Helper: - static std::string getKey(const std::string & addr, int port, int socketId) throw() { + static std::string getKey(const std::string & addr, int port, int socketId) { return (anna::functions::asString("%s:%d|%d", addr.c_str(), port, socketId)); } @@ -63,7 +63,7 @@ public: ClientSession(); - /* virtual */void initialize() throw(); + /* virtual */void initialize() ; /** * Default watchdog period for the diameter client-session health. @@ -73,49 +73,49 @@ public: /** Client session key:
:| */ - std::string getKey() const throw() { return ClientSession::getKey(getAddress(), getPort(), getSocketId()); } + std::string getKey() const { return ClientSession::getKey(getAddress(), getPort(), getSocketId()); } /** Diameter server address (IPv4 or hostname) \return Diameter server address */ - /* virtual */const std::string& getAddress() const throw(); + /* virtual */const std::string& getAddress() const ; /** Diameter server listen port \return Diameter server listen port */ - /* virtual */int getPort() const throw(); + /* virtual */int getPort() const ; /** Diameter parent server. \return Diameter parent server. */ - const Server *getParent() const throw() { return a_parent; } + const Server *getParent() const { return a_parent; } /** Diameter server created at diameter::comm::Engine::createClientSession. \return Diameter server */ - anna::comm::Server * getServer() throw() { return a_server; } + anna::comm::Server * getServer() { return a_server; } /** Disables server resource (avoid the use of the server) */ - void disable() throw() { a_server->disable(); } + void disable() { a_server->disable(); } /** Sets auto recovery indicator. When a connection is lost, by default it will be recovered automatically. \param autoRecovery Auto recovery indicator. TRue by default. */ - void setAutoRecovery(bool autoRecovery = true) throw() { a_autoRecovery = autoRecovery; a_server->setAutoRecovery(autoRecovery); } + void setAutoRecovery(bool autoRecovery = true) { a_autoRecovery = autoRecovery; a_server->setAutoRecovery(autoRecovery); } /** Gets the auto recovery indicator for the client connection (client-session). @return Auto recovery indicator. */ - bool getAutoRecovery() const throw() { return a_autoRecovery; } + bool getAutoRecovery() const { return a_autoRecovery; } /** Sets the milliseconds wait to achieve a client connection to server by mean connect primitive. @@ -124,14 +124,14 @@ public: \param maxConnectionDelay Milliseconds wait to get connection */ - void setMaxConnectionDelay(const anna::Millisecond & maxConnectionDelay) throw() { a_server->setMaxConnectionDelay(maxConnectionDelay); } + void setMaxConnectionDelay(const anna::Millisecond & maxConnectionDelay) { a_server->setMaxConnectionDelay(maxConnectionDelay); } /** Gets the milliseconds wait to achieve a client connection to server by mean connect primitive. \return Milliseconds wait to get connection */ - const anna::Millisecond & getMaxConnectionDelay() throw() { return a_server->getMaxConnectionDelay(); } + const anna::Millisecond & getMaxConnectionDelay() { return a_server->getMaxConnectionDelay(); } /** * Sets CER and DWR diameter messages to be used over created client-sessions @@ -139,40 +139,40 @@ public: * @param cer Capabilities-Exchange-Request message (encoded) for the client-sessions bind. * @param dwr Device-Watchdog-Request message (encoded) for the client-sessions keep-alive. */ - void setCERandDWR(const anna::DataBlock & cer, const anna::DataBlock & dwr) throw(anna::RuntimeException); + void setCERandDWR(const anna::DataBlock & cer, const anna::DataBlock & dwr) noexcept(false); // Internal - void bind() throw(anna::RuntimeException); + void bind() noexcept(false); - /* virtual */const Response* send(const Message* message) throw(anna::RuntimeException); - /* virtual */bool unbind(bool forceDisconnect /* se usa en timer, para el actionTimer del tipo SessionUnbind, etc. */ = false) throw(anna::RuntimeException); // returns true if done at call time (no pendings or ignore pendings, except Disconnecting state by mean DPR/DPA) + /* virtual */const Response* send(const Message* message) noexcept(false); + /* virtual */bool unbind(bool forceDisconnect /* se usa en timer, para el actionTimer del tipo SessionUnbind, etc. */ = false) noexcept(false); // returns true if done at call time (no pendings or ignore pendings, except Disconnecting state by mean DPR/DPA) /** Deny resource for delivery restriction */ - void hide() throw() { a_hidden = true; } + void hide() { a_hidden = true; } /** Allow resource for delivery permission */ - void show() throw() { a_hidden = false; } + void show() { a_hidden = false; } /** Returns true when client session resource is hidden for application messages delivery */ - bool hidden() const throw() { return a_hidden; } + bool hidden() const { return a_hidden; } /** Returns true when client session resource is shown for application messages delivery */ - bool shown() const throw() { return !a_hidden; } + bool shown() const { return !a_hidden; } /** Class string representation \return String with relevant information for this instance. */ - /* virtual */std::string asString() const throw(); + /* virtual */std::string asString() const ; /** @@ -180,7 +180,7 @@ public: \param parent Parent XML node on which hold this instance information. \return XML document with relevant information for this instance. */ - /* virtual */anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + /* virtual */anna::xml::Node* asXML(anna::xml::Node* parent) const ; private: @@ -210,19 +210,19 @@ private: }; }; WatchdogState::_v a_watchdogState; - void setWatchdogState(WatchdogState::_v wState) throw(); + void setWatchdogState(WatchdogState::_v wState) ; - /* virtual */void expire(anna::timex::Engine *timeController) throw(anna::RuntimeException); - void setWatchdogPeriod(const anna::Millisecond & watchdogPeriod) throw(); + /* virtual */void expire(anna::timex::Engine *timeController) noexcept(false); + void setWatchdogPeriod(const anna::Millisecond & watchdogPeriod) ; - /*virtual*/ void timerStopped() throw(); - /*virtual*/ void timerStarted() throw(); + /*virtual*/ void timerStopped() ; + /*virtual*/ void timerStarted() ; // Activity: - /* virtual */void updateIncomingActivityTime() throw(); - /* virtual */void updateOutgoingActivityTime() throw(); - void countSendings(const diameter::CommandId & cid, unsigned int aid, bool ok) throw(); + /* virtual */void updateIncomingActivityTime() ; + /* virtual */void updateOutgoingActivityTime() ; + void countSendings(const diameter::CommandId & cid, unsigned int aid, bool ok) ; // Handlers: /** @@ -230,60 +230,60 @@ private: When notified, ANNA.diameter.comm generates an diameter::comm::ClientSession::eventResponse for every request with pending answers. */ - void eventPeerShutdown() throw(); + void eventPeerShutdown() ; /** Handler about a request retransmission over the session. \param request Message retransmitted */ - void eventRequestRetransmission(Message *request) throw(); + void eventRequestRetransmission(Message *request) ; /** Handler for diameter server (client-session) responses \param response Answer container object for corresponding diameter request */ - void eventResponse(const Response& response) throw(anna::RuntimeException); + void eventResponse(const Response& response) noexcept(false); /** Handler for diameter server (client-session) requests \param request Request data block object for corresponding diameter reception */ - void eventRequest(const anna::DataBlock& request) throw(anna::RuntimeException); - //void eventRequest(const Message& request) throw(anna::RuntimeException); + void eventRequest(const anna::DataBlock& request) noexcept(false); + //void eventRequest(const Message& request) noexcept(false); /** Handler for diameter server (client-session) responses out of context \param response Answer data block object without context match */ - void eventUnknownResponse(const anna::DataBlock& response) throw(anna::RuntimeException); + void eventUnknownResponse(const anna::DataBlock& response) noexcept(false); /** Handler for diameter server (client-session) Disconnect-Peer-Answer messages \param response Answer data block object without context match */ - void eventDPA(const anna::DataBlock& response) throw(anna::RuntimeException); + void eventDPA(const anna::DataBlock& response) noexcept(false); /** * Handlers for receptions */ - /* virtual */void receive(const anna::comm::Message& message) throw(anna::RuntimeException); - /* virtual */void finalize() throw(); - void recover() throw(); + /* virtual */void receive(const anna::comm::Message& message) noexcept(false); + /* virtual */void finalize() ; + void recover() ; - /* virtual */void expireResponse(Response*) throw(); - /* virtual */void setState(State::_v state) throw(); + /* virtual */void expireResponse(Response*) ; + /* virtual */void setState(State::_v state) ; - void sendDWAToServer(const anna::DataBlock& dwrDB) throw(anna::RuntimeException); // non-usual behaviour, but DWR could be received from server + void sendDWAToServer(const anna::DataBlock& dwrDB) noexcept(false); // non-usual behaviour, but DWR could be received from server // helpers - static const char* asText(const WatchdogState::_v) throw(); + static const char* asText(const WatchdogState::_v) ; friend class Server;