X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/a9cb053146d2f1dc73e536ed87597f458deebea3..eb72ddd1b0a1004fa3da51db5b7790370cc5c2e9:/Server/src/server.cpp diff --git a/Server/src/server.cpp b/Server/src/server.cpp index c0d0341..81285cb 100644 --- a/Server/src/server.cpp +++ b/Server/src/server.cpp @@ -25,41 +25,49 @@ // $Id$ // -#include "server.h" +#include "plaqui/server/server.h" #ifdef DEBUG # include #endif // DEBUG -using namespace Plaqui; +PlaQui::Server::Server::~Server(void) { +#ifdef DEBUG + std::cerr << __FILE__ << ": destructor." << std::endl; +#endif // DEBUG +} -Server::Server(int port): - socket(sockbuf::sock_stream) { - socket.bind(port); +PlaQui::Server::Server::Server(int port): + PlaQui::Server::Server::TCPServer(port) { #ifdef DEBUG - std::cerr << "Escuchando en " << socket.localhost() << - ":" << socket.localport() << "." << std::endl; + std::cerr << __FILE__ << ": port = " << port << std::endl; #endif // DEBUG - socket.listen(); } -bool Server::start_transmission(std::string host, int port) { +/// \todo Implementar. +bool PlaQui::Server::Server::start_transmission(std::string host, int port) { +#ifdef DEBUG + std::cerr << __FILE__ << ": start_transmission(host = " << host + << " | port = " << port << ")" << std::endl; +#endif // DEBUG // TODO return false; } -bool Server::stop_transmission(std::string host, int port) { +/// \todo Implementar. +bool PlaQui::Server::Server::stop_transmission(std::string host, int port) { +#ifdef DEBUG + std::cerr << __FILE__ << ": stop_transmission(host = " << host + << " | port = " << port << ")" << std::endl; +#endif // DEBUG // TODO return false; } -void Server::real_run(void) { - // FIXME se tiene que ir a la clase para poder frenarlo desde afuera. - bool stop = false; - ControlServer* control_server; - while (!stop) { - control_server = new ControlServer(socket.accept()); - controllers.push_back(control_server); - control_server->run(); - } +/// \todo Implementar. +void PlaQui::Server::Server::on_control_command_received(void* command) { +#ifdef DEBUG + std::cerr << __FILE__ << ": on_control_command_received(command = " + << command << ")" << std::endl; +#endif // DEBUG }