X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/65bf2eef7ac487329a3af3cd1c06e7957afc3a6c..802f79cdb0d688127b8a639cd3173d801a1466cd:/Server/src/server.cpp diff --git a/Server/src/server.cpp b/Server/src/server.cpp index bbf41c0..1206b1c 100644 --- a/Server/src/server.cpp +++ b/Server/src/server.cpp @@ -25,25 +25,41 @@ // $Id$ // -#include "server.h" +#include "plaqui/server/server.h" +#ifdef DEBUG +# include +#endif // DEBUG -using namespace Plaqui; +using namespace PlaQui::Server; Server::Server(int port): socket(sockbuf::sock_stream) { -#warning Not implemented! - // TODO + socket.bind(port); +#ifdef DEBUG + std::cerr << "Escuchando en " << socket.localhost() << + ":" << socket.localport() << "." << std::endl; +#endif // DEBUG + socket.listen(); } bool Server::start_transmission(std::string host, int port) { -#warning Not implemented! // TODO return false; } bool Server::stop_transmission(std::string host, int port) { -#warning Not implemented! // 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(); + } +} +