X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/314ccce75a8585f940b69ff40faecc1725abbe37..292425c2f65528535f137b437e629c5785c870d0:/Server/src/server.cpp diff --git a/Server/src/server.cpp b/Server/src/server.cpp index 4d25ff6..134bcf5 100644 --- a/Server/src/server.cpp +++ b/Server/src/server.cpp @@ -26,6 +26,9 @@ // #include "plaqui/server/server.h" +#include "plaqui/server/connection.h" +#include "plaqui/server/controlserver.h" +#include #ifdef DEBUG # include #endif // DEBUG @@ -37,7 +40,7 @@ PlaQui::Server::Server::~Server(void) { } PlaQui::Server::Server::Server(int port): - PlaQui::Server::TCPServer(port) { + TCPServer(port) { #ifdef DEBUG std::cerr << __FILE__ << ": port = " << port << std::endl; #endif // DEBUG @@ -52,6 +55,20 @@ bool PlaQui::Server::Server::start_transmission(std::string host, int port) { // TODO return false; } + +PlaQui::Server::Connection* PlaQui::Server::Server::new_connection( + const sockbuf::sockdesc& sd) { +#ifdef DEBUG + std::cerr << __FILE__ << ": new_connection(sd = " << sd.sock << ")" + << std::endl; +#endif // DEBUG + ControlServer* connection = new ControlServer(sd); + // TODO verificar si el new se hace bien? no creo. + connection->signal_command_received().connect( + SigC::slot_class(*this, &Server::on_control_command_received)); + // TODO: + return connection; +} /// \todo Implementar. bool PlaQui::Server::Server::stop_transmission(std::string host, int port) {