X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/e46a2c7e43af9156a434d9cf41c2beb5b25b36d1..a5853e30ca27518a7a3a33e4f97588f7b1e9ffe3:/Server/src/transmitter.cpp diff --git a/Server/src/transmitter.cpp b/Server/src/transmitter.cpp index 6ab9260..9d0e24d 100644 --- a/Server/src/transmitter.cpp +++ b/Server/src/transmitter.cpp @@ -64,14 +64,13 @@ Transmitter::Transmitter(const string& _host, const Connection::Port& _port) #endif // DEBUG } -/// \todo debría dar una excepción (?) -void Transmitter::real_run(void) { +void Transmitter::real_run(void) throw() { #ifdef DEBUG cerr << __FILE__ << "(" << __LINE__ << ")" << ": real_run()." << endl; #endif // DEBUG // No hace nada, porque solo actua cuando se manda algo con send(). - while (!stop) { + while (!stop()) { Glib::usleep(500000); // 1/2 segundo } } @@ -82,14 +81,14 @@ void Transmitter::send(const string& data) { << ": send()." << endl; // << ": send(data = " << data << ")." << endl; #endif // DEBUG - if (stop) { + if (stop()) { return; } try { socket << data << flush; } catch (const sockerr& e) { - error(e.serrno(), e.errstr()); - stop = true; + signal_error().emit(e.serrno(), e.errstr()); + stop(true); } }