X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FMyCommunicator.hpp;h=f5730699350aa5edccb97a571b3922b487fd248a;hb=1061cb8cf19ca6d594505c3e487606c0dd0634ff;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hpb=68a8fe342d8337ec1a86b57920bc7dcf7faf2413;p=anna.git diff --git a/example/diameter/launcher/MyCommunicator.hpp b/example/diameter/launcher/MyCommunicator.hpp index e69de29..f573069 100644 --- a/example/diameter/launcher/MyCommunicator.hpp +++ b/example/diameter/launcher/MyCommunicator.hpp @@ -0,0 +1,38 @@ +// 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 +#include +#include + +// Process +#include + + +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: + using anna::comm::Communicator::eventBreakConnection; + + anna::ThreadData a_contexts; + void eventReceiveMessage(anna::comm::ClientSocket&, const anna::comm::Message&) throw(anna::RuntimeException); + void eventBreakConnection(Server* server) throw(); +}; + +#endif