//
#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
}
PlaQui::Server::Server::Server(int port):
- PlaQui::Server::Server::TCPServer(port) {
+ TCPServer(port) {
#ifdef DEBUG
std::cerr << __FILE__ << ": port = " << port << std::endl;
#endif // DEBUG
// 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) {