X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/00cffd5f7c35a915c09d55e6292775e9e01bdeec..f53d095dd5ffb5afacf5c6f9a23d6cf1985fc237:/Server/src/transmitter.cpp?ds=sidebyside diff --git a/Server/src/transmitter.cpp b/Server/src/transmitter.cpp index 268f216..4211e51 100644 --- a/Server/src/transmitter.cpp +++ b/Server/src/transmitter.cpp @@ -32,34 +32,44 @@ # include #endif // DEBUG -PlaQui::Server::Transmitter::~Transmitter(void) { +using namespace std; + +namespace PlaQui { + +namespace Server { + +Transmitter::~Transmitter(void) { #ifdef DEBUG - std::cerr << __FILE__ << ": destructor." << std::endl; + cerr << __FILE__ << ": destructor." << endl; #endif // DEBUG } /// \todo debría conectarse en real_run() (?) -PlaQui::Server::Transmitter::Transmitter(std::string host, int port): - PlaQui::Server::Connection(sockbuf::sock_dgram) { +Transmitter::Transmitter(string host, int port): + Connection(sockbuf::sock_dgram) { #ifdef DEBUG - std::cerr << __FILE__ << ": host = " << host - << " | port = " << port << std::endl; + cerr << __FILE__ << ": host = " << host + << " | port = " << port << endl; #endif // DEBUG // FIXME - deberia ir en run(). socket->connect(host.c_str(), port); } /// \todo debría dar una excepción (?) -void PlaQui::Server::Transmitter::real_run(void) { +void 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() << - ":" << socket->peerport() << "." << std::endl; + cerr << "No se pudo conectar a " << socket->peerhost() << + ":" << socket->peerport() << "." << endl; } else { - std::cerr << "Conectado a " << socket->peerhost() << - ":" << socket->peerport() << "." << std::endl; + cerr << "Conectado a " << socket->peerhost() << + ":" << socket->peerport() << "." << endl; } #endif // DEBUG } +} // namespace Server + +} // namespace PlaQui +