X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/7e74b790d290cd7d776349503bb361c47933c01f..bed1e8f7b596cf1aa73c25b8b39dcffe145fa018:/Server/src/transmitter.cpp diff --git a/Server/src/transmitter.cpp b/Server/src/transmitter.cpp index b59992e..9d0e24d 100644 --- a/Server/src/transmitter.cpp +++ b/Server/src/transmitter.cpp @@ -64,31 +64,31 @@ 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 } } void Transmitter::send(const string& data) { #ifdef DEBUG - cerr << __FILE__ << "(" << __LINE__ << ")" - << ": send(data = " << data << ")." << endl; + cerr << __FILE__ << "(" << __LINE__ << ")" + << ": 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); } }