X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/6e0194f46ac77c18bfeabf84ef94a32f23e41073..2686d511ecfa9bdd0693fc3e1c8320e52188beb4:/Server/src/transmitter.cpp?ds=sidebyside diff --git a/Server/src/transmitter.cpp b/Server/src/transmitter.cpp index d4306e3..75f622d 100644 --- a/Server/src/transmitter.cpp +++ b/Server/src/transmitter.cpp @@ -28,16 +28,30 @@ #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 }