+// ANNA - Anna is Not Nothingness Anymore //
+// //
+// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
+// //
+// See project site at http://redmine.teslayout.com/projects/anna-suite //
+// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
+
+
+#ifndef example_diameter_launcher_MyCommunicator_hpp
+#define example_diameter_launcher_MyCommunicator_hpp
+
+// Project
+#include <anna/core/core.hpp>
+#include <anna/comm/comm.hpp>
+#include <anna/diameter/codec/Message.hpp>
+
+// Process
+#include <MyHandler.hpp>
+
+
+class MyCommunicator : public anna::comm::Communicator {
+public:
+ MyCommunicator(const anna::comm::Communicator::WorkMode::_v acceptMode = anna::comm::Communicator::WorkMode::Single) : anna::comm::Communicator(acceptMode),
+ a_contexts("Contexts")
+ {;}
+
+ void prepareAnswer(anna::diameter::codec::Message *answer, const anna::DataBlock &request) const throw();
+ void terminate() throw();
+
+private:
+ anna::ThreadData <MyHandler> a_contexts;
+ void eventReceiveMessage(anna::comm::ClientSocket&, const anna::comm::Message&) throw(anna::RuntimeException);
+ void eventBreakConnection(Server* server) throw();
+};
+
+#endif