X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=include%2Fanna%2Fdiameter.comm%2FServer.hpp;fp=include%2Fanna%2Fdiameter.comm%2FServer.hpp;h=711fdcdb41c28f7f58ff62bdb18ff98b4e59e651;hp=8d5dea9b6c7b4fd1e7966a0b90d91d7179907c0a;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hpb=af9c86ffb0e28d35ad94d99c5f77e41578c972b4 diff --git a/include/anna/diameter.comm/Server.hpp b/include/anna/diameter.comm/Server.hpp index 8d5dea9..711fdcd 100644 --- a/include/anna/diameter.comm/Server.hpp +++ b/include/anna/diameter.comm/Server.hpp @@ -67,28 +67,28 @@ class Server { // Activity anna::Millisecond a_lastIncomingActivityTime; // last unix timestamp (in milliseconds) when message reception was managed over this server anna::Millisecond a_lastOutgoingActivityTime; // last unix timestamp (in milliseconds) when message sending was managed over this server - void updateIncomingActivityTime() throw(); - void updateOutgoingActivityTime() throw(); + void updateIncomingActivityTime() ; + void updateOutgoingActivityTime() ; // Engine Engine *a_engine; // Statistics MessageStatistics a_messageStatistics; - void initializeStatisticResources() throw(); - void resetStatistics() throw(); + void initializeStatisticResources() ; + void resetStatistics() ; // Availability bool a_available; // any of the client-sessions must be bound - void availabilityLost() throw(); - void availabilityRecovered() throw(); - bool refreshAvailability() throw(); // return true if change - void assertReady() throw(anna::RuntimeException); - void initialize() throw(); - void childIdle() const throw(); + void availabilityLost() ; + void availabilityRecovered() ; + bool refreshAvailability() ; // return true if change + void assertReady() noexcept(false); + void initialize() ; + void childIdle() const ; // Private close/destroy method - void close(bool destroy) throw(anna::RuntimeException); + void close(bool destroy) noexcept(false); public: @@ -110,7 +110,7 @@ public: * * \param socketId Diameter socket identifier within the server. */ - void addClientSession(int socketId) throw(anna::RuntimeException); + void addClientSession(int socketId) noexcept(false); /** Set timeout to consider failed a request. @@ -119,34 +119,34 @@ public: Timers are internally managed and automatically activated. */ - void setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) throw(); + void setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) ; /** * Binds server client-sessions. * * @return Returns true if all client-session were successfully bound */ - bool bind() throw(anna::RuntimeException); + bool bind() noexcept(false); /** * Propagate auto recovery configuration to client-sessions within server * * @param autoRecovery Auto recovery indicator. True by default. */ - void raiseAutoRecovery(bool autoRecovery = true) throw(anna::RuntimeException); + void raiseAutoRecovery(bool autoRecovery = true) noexcept(false); // Sent a message to the server using a certain client-session by mean round-robin between socketId's for // multiple client client-sessions functionality. If a specific socketId is provided, then uses such specific client-session. // Last used delivery resource could be known through #getLastUsedResource(). - bool send(const Message*, int socketId = -1 /* client-sessions round-robin */) throw(anna::RuntimeException); - bool send(const Message& message, int socketId = -1 /* client-sessions round-robin */) throw(anna::RuntimeException) { return send(&message, socketId); } + bool send(const Message*, int socketId = -1 /* client-sessions round-robin */) noexcept(false); + bool send(const Message& message, int socketId = -1 /* client-sessions round-robin */) noexcept(false) { return send(&message, socketId); } /** Gets the last used resource (client session) during sending. Broadcast doesn't updates this information. */ - ClientSession *getLastUsedResource() const throw() { return (a_lastUsedResource); } + ClientSession *getLastUsedResource() const { return (a_lastUsedResource); } /** Sent a message to all the server client-sessions (socketId's) for multiple client client-sessions functionality. @@ -154,53 +154,53 @@ public: Returns true (success) only when broadcast is success over all the server client-sessions. If any client-session fails, then false is returned. Broadcast try to send all over the resources in spite of any fail. */ - bool broadcast(const Message*) throw(anna::RuntimeException); - bool broadcast(const Message& message) throw(anna::RuntimeException) { return broadcast(&message); } + bool broadcast(const Message*) noexcept(false); + bool broadcast(const Message& message) noexcept(false) { return broadcast(&message); } /** Close all the server client-sessions. Depending on client-session configuration ('OnDisconnect' behaviour), pending answers will be wait (graceful) or ignored (immediate-abrupt close). Resources are not destroyed. */ - void close() throw(anna::RuntimeException) { close(false /* no destroy */); } + void close() noexcept(false) { close(false /* no destroy */); } /** Diameter parent entity. \return Diameter parent entity. */ - const Entity *getParent() const throw() { return a_parent; } + const Entity *getParent() const { return a_parent; } /** Returns true when any of the server client-sessions is Bound. False when all not-bound. */ - bool isAvailable() const throw() { return a_available; } + bool isAvailable() const { return a_available; } - std::vector::iterator begin() throw() { return a_clientSessions.begin(); } - std::vector::iterator end() throw() { return a_clientSessions.end(); } - std::vector::const_iterator begin() const throw() { return a_clientSessions.begin(); } - std::vector::const_iterator end() const throw() { return a_clientSessions.end(); } + std::vector::iterator begin() { return a_clientSessions.begin(); } + std::vector::iterator end() { return a_clientSessions.end(); } + std::vector::const_iterator begin() const { return a_clientSessions.begin(); } + std::vector::const_iterator end() const { return a_clientSessions.end(); } - int getNumberOfClientSessions() const throw() { return a_clientSessions.size(); } - int getMaxClientSessions() const throw() { return a_maxClientSessions; } - void setMaxClientSessions(int maxClientSessions) throw() { a_maxClientSessions = maxClientSessions; } + int getNumberOfClientSessions() const { return a_clientSessions.size(); } + int getMaxClientSessions() const { return a_maxClientSessions; } + void setMaxClientSessions(int maxClientSessions) { a_maxClientSessions = maxClientSessions; } /** Diameter server address (IP or hostname) \return Diameter server address. */ - const std::string& getAddress() const throw() { return a_socket.first; } + const std::string& getAddress() const { return a_socket.first; } /** Diameter server port. \return Diameter server port. */ - int getPort() const throw() { return a_socket.second; } + int getPort() const { return a_socket.second; } /** Server presentation as 'ADDRESS:PORT' */ - std::string socketAsString() const throw(); + std::string socketAsString() const ; /** @@ -208,14 +208,14 @@ public: @return Last incoming activity timestamp. */ - const anna::Millisecond & getLastIncomingActivityTime() const throw() { return a_lastIncomingActivityTime; } + const anna::Millisecond & getLastIncomingActivityTime() const { return a_lastIncomingActivityTime; } /** Gets the timestamp for last outgoing activity over the server. @return Last outgoing activity timestamp. */ - const anna::Millisecond & getLastOutgoingActivityTime() const throw() { return a_lastOutgoingActivityTime; } + const anna::Millisecond & getLastOutgoingActivityTime() const { return a_lastOutgoingActivityTime; } /** @@ -223,58 +223,58 @@ public: @return OTA messages. */ - int getOTARequests() const throw(); + int getOTARequests() const ; /** Returns idle state (no pending answers). @return Idle state. */ - bool idle() const throw() { return (getOTARequests() == 0); } + bool idle() const { return (getOTARequests() == 0); } /** Deny resources for delivery restriction. Deny all its client sessions */ - void hide() throw(); + void hide() ; /** Allow resource for delivery permission. Allow all its client sessions */ - void show() throw(); + void show() ; /** Returns true when all its client session resources are hidden for application messages delivery */ - bool hidden() const throw(); + bool hidden() const ; /** Returns true when all its client session resources are shown for application messages delivery */ - bool shown() const throw(); + bool shown() const ; /** Class string representation \return String with relevant information for this instance. */ - std::string asString() const throw(); + std::string asString() const ; /** Class xml representation \param parent Parent XML node on which hold this instance information. \return XML document with relevant information for this instance. */ - anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + anna::xml::Node* asXML(anna::xml::Node* parent) const ; // Statistics - void updateProcessingTimeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) throw(); - void updateReceivedMessageSizeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) throw(); -// int getProcessingTimeStatisticConcept() const throw() { return a_processing_time__StatisticConceptId; } -// int getReceivedMessageSizeStatisticConcept() const throw() { return a_received_message_size__StatisticConceptId; } + void updateProcessingTimeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) ; + void updateReceivedMessageSizeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) ; +// int getProcessingTimeStatisticConcept() const { return a_processing_time__StatisticConceptId; } +// int getReceivedMessageSizeStatisticConcept() const { return a_received_message_size__StatisticConceptId; } protected: @@ -283,21 +283,21 @@ protected: When notified, ANNA.diameter.comm generates an diameter::comm::Entity::eventResponse for every request with pending answers. */ - virtual void eventPeerShutdown(const ClientSession*) throw(); + virtual void eventPeerShutdown(const ClientSession*) ; /** Handler about a request retransmission over the session. \param request Message retransmitted */ - virtual void eventRequestRetransmission(const ClientSession*, Message *request) throw(); + virtual void eventRequestRetransmission(const ClientSession*, Message *request) ; /** Handler for diameter server (client-session) responses \param response Answer container object for corresponding diameter request */ - virtual void eventResponse(const Response & response) throw(anna::RuntimeException); + virtual void eventResponse(const Response & response) noexcept(false); /** Handler for diameter server (client-session) requests @@ -305,8 +305,8 @@ protected: \param clientSession ClientSession from which request has been received \param request Diameter request message received */ - virtual void eventRequest(ClientSession *clientSession, const anna::DataBlock &request) throw(anna::RuntimeException); - //virtual void eventRequest(ClientSession *clientSession, const Message & request) throw(anna::RuntimeException); + virtual void eventRequest(ClientSession *clientSession, const anna::DataBlock &request) noexcept(false); + //virtual void eventRequest(ClientSession *clientSession, const Message & request) noexcept(false); /** Handler for diameter server (client-session) responses out of context @@ -314,7 +314,7 @@ protected: \param clientSession ClientSession from which request has been received \param response Answer data block object without context match */ - virtual void eventUnknownResponse(ClientSession *clientSession, const anna::DataBlock& response) throw(anna::RuntimeException); + virtual void eventUnknownResponse(ClientSession *clientSession, const anna::DataBlock& response) noexcept(false); /** Handler for diameter server (client-session) Disconnect-Peer-Answer messages @@ -322,7 +322,7 @@ protected: \param clientSession ClientSession from which request has been received \param response Answer data block object without context match */ - virtual void eventDPA(ClientSession *clientSession, const anna::DataBlock& response) throw(anna::RuntimeException); + virtual void eventDPA(ClientSession *clientSession, const anna::DataBlock& response) noexcept(false);