]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Server/src/server.cpp
Se agrega la definicion del metodo new_connection() que era lo que daba un error...
[z.facultad/75.42/plaqui.git] / Server / src / server.cpp
index 4d25ff6b05e4539dadd91cb77c40809a464b86ca..8f33449f4904a5d6fa971e1ce2faba79b1c44a65 100644 (file)
@@ -26,6 +26,9 @@
 //
 
 #include "plaqui/server/server.h"
+#include "plaqui/server/connection.h"
+#include "plaqui/server/controlserver.h"
+#include <sigc++/class_slot.h>
 #ifdef DEBUG
 #      include <iostream>
 #endif // DEBUG
@@ -52,6 +55,21 @@ 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
+       PlaQui::Server::ControlServer* conn = new PlaQui::Server::ControlServer(sd);
+       // TODO verificar si el new se hace bien? no creo.
+       conn->signal_command_received().connect(
+                       SigC::slot_class(*this,
+                               &PlaQui::Server::Server::on_control_command_received));
+       // TODO: 
+       return conn;
+}
 
 /// \todo Implementar.
 bool PlaQui::Server::Server::stop_transmission(std::string host, int port) {