X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/a9cb053146d2f1dc73e536ed87597f458deebea3..2686d511ecfa9bdd0693fc3e1c8320e52188beb4:/Server/src/transmitter.cpp diff --git a/Server/src/transmitter.cpp b/Server/src/transmitter.cpp index bd6d06b..75f622d 100644 --- a/Server/src/transmitter.cpp +++ b/Server/src/transmitter.cpp @@ -25,19 +25,33 @@ // $Id$ // -#include "transmitter.h" +#include "plaqui/server/transmitter.h" #include #include +#ifdef DEBUG +# include +#endif // DEBUG -using namespace Plaqui; +PlaQui::Server::Transmitter::~Transmitter(void) { +#ifdef DEBUG + std::cerr << __FILE__ << ": destructor." << std::endl; +#endif // DEBUG +} -Transmitter::Transmitter(std::string host, int port): +/// \todo debría conectarse en real_run() (?) +PlaQui::Server::Transmitter::Transmitter(std::string host, int port): Connection(sockbuf::sock_dgram) { +#ifdef DEBUG + std::cerr << __FILE__ << ": host = " << host + << " | port = " << port << std::endl; +#endif // DEBUG // FIXME - deberia ir en run(). socket->connect(host.c_str(), port); } -void Transmitter::real_run(void) { +/// \todo debría dar una excepción (?) +void PlaQui::Server::Transmitter::real_run(void) { +#ifdef DEBUG // FIXME - debería tirar una excepción? if (!socket->is_open()) { std::cerr << "No se pudo conectar a " << socket->peerhost() << @@ -46,5 +60,6 @@ void Transmitter::real_run(void) { std::cerr << "Conectado a " << socket->peerhost() << ":" << socket->peerport() << "." << std::endl; } +#endif // DEBUG }