X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/a9cb053146d2f1dc73e536ed87597f458deebea3..eb72ddd1b0a1004fa3da51db5b7790370cc5c2e9:/Server/src/transmitter.cpp?ds=inline diff --git a/Server/src/transmitter.cpp b/Server/src/transmitter.cpp index bd6d06b..268f216 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): - Connection(sockbuf::sock_dgram) { +/// \todo debría conectarse en real_run() (?) +PlaQui::Server::Transmitter::Transmitter(std::string host, int port): + PlaQui::Server::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 }