X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/802f79cdb0d688127b8a639cd3173d801a1466cd..751302dd67ffdeb0dfe72c4d2a7a2d58303cf5f3:/Server/src/transmitter.cpp?ds=inline diff --git a/Server/src/transmitter.cpp b/Server/src/transmitter.cpp index 37113cc..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::Server; +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 }