X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/802f79cdb0d688127b8a639cd3173d801a1466cd..f6e29f2008bf5f440000fb647a4782136929c1a1:/Server/src/controlserver.cpp?ds=sidebyside diff --git a/Server/src/controlserver.cpp b/Server/src/controlserver.cpp index 8789af1..0587bc1 100644 --- a/Server/src/controlserver.cpp +++ b/Server/src/controlserver.cpp @@ -29,18 +29,24 @@ #include "plaqui/server/request.h" #include #include +#ifdef DEBUG +# include +#endif // DEBUG -using namespace PlaQui::Server; +PlaQui::Server::ControlServer::~ControlServer(void) { +#ifdef DEBUG + std::cerr << __FILE__ << ": destructor." << std::endl; +#endif // DEBUG +} -ControlServer::ControlServer(const sockbuf::sockdesc& sd): - Connection(sd) { +PlaQui::Server::ControlServer::ControlServer(const sockbuf::sockdesc& sd): + ServerConnection(sd) { #ifdef DEBUG - std::cerr << "Compilado el " << __DATE__ << std::endl; std::cerr << __FILE__ << ": sd = " << sd.sock << std::endl; #endif // DEBUG } -void ControlServer::real_run(void) { +void PlaQui::Server::ControlServer::real_run(void) { // FIXME se tiene que ir a la clase para poder frenarlo desde afuera. bool stop = false; char buf[BUFFER_SIZE]; @@ -50,7 +56,7 @@ void ControlServer::real_run(void) { bool is_first = true; while (!stop && socket.getline(buf, BUFFER_SIZE)) { #ifdef DEBUG - std::cerr << "Reciviendo linea: " << buf << std::endl; + std::cerr << "Recibiendo linea: " << buf << std::endl; #endif // DEBUG int len = strlen(buf); // Si tiene un retorno de carro, lo elimina. @@ -78,7 +84,8 @@ void ControlServer::real_run(void) { // Si es la primera, no pasa nada, sigue esperando un request. } } - // Manda mensaje a la planta. + // TODO: Manda mensaje a la planta. + //signal_command_received().emit(request); //dispatch_command(parse_command(sstr.str())); #ifdef DEBUG std::cerr << "Request: " << std::endl;