X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fcomm%2Fblocker%2Fmain.cpp;h=c166abf9b08fcceb711fd97d9b07ff26b03c7e69;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hp=c8723b532d41248d3dc19b342fa007afd127e506;hpb=93366a0bda79e6fd6e7dad6316bfcf8cc82f5731;p=anna.git diff --git a/example/comm/blocker/main.cpp b/example/comm/blocker/main.cpp index c8723b5..c166abf 100644 --- a/example/comm/blocker/main.cpp +++ b/example/comm/blocker/main.cpp @@ -31,7 +31,7 @@ public: MyCommunicator () {;} private: - void eventReceiveMessage (comm::ClientSocket&, const Message&) throw (RuntimeException); + void eventReceiveMessage (comm::ClientSocket&, const Message&) noexcept(false); }; class Blocker : public comm::Application { @@ -42,8 +42,8 @@ private: MyCommunicator a_communicator; comm::ServerSocket* a_blockerSocket; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -88,7 +88,7 @@ Blocker::Blocker () : // Inicializa el servidor de sockets. //----------------------------------------------------------------------------------------- void Blocker::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -104,7 +104,7 @@ void Blocker::initialize () // Cuando hay un nuevo mensaje invocar�a Communicator::eventReceiveMessage //----------------------------------------------------------------------------------------- void Blocker::run () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -120,7 +120,7 @@ void Blocker::run () // Cuando recibe el primer mensaje deja al sistema bloqueado esperando una tecla. //----------------------------------------------------------------------------------------- void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Message& message) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventReceiveMessage", ANNA_FILE_LOCATION)); static bool blocking = true; @@ -134,7 +134,7 @@ void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Mess app::Application& app = app::functions::getApp (); cout << "Bloqueando las comunicaciones ejecute (kill -9 " << app.getPid () << ") ... " << flush; while (stop == false) { - if (gets (aux) != NULL) { + if (fgets(aux, sizeof(aux), stdin) != NULL) { if (aux [0] == 'q' || aux [0] == 'Q') stop = true; }