]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
Archivos para la nueva implementacion del server.
authorLeandro Lucarella <llucax@gmail.com>
Wed, 22 Oct 2003 04:00:16 +0000 (04:00 +0000)
committerLeandro Lucarella <llucax@gmail.com>
Wed, 22 Oct 2003 04:00:16 +0000 (04:00 +0000)
Server/include/plaqui/server/serverconnection.h [new file with mode: 0644]
Server/src/serverconnection.cpp [new file with mode: 0644]

diff --git a/Server/include/plaqui/server/serverconnection.h b/Server/include/plaqui/server/serverconnection.h
new file mode 100644 (file)
index 0000000..91fa37f
--- /dev/null
@@ -0,0 +1,78 @@
+// vim: set noexpandtab tabstop=4 shiftwidth=4:
+//----------------------------------------------------------------------------
+//                                  PlaQui
+//----------------------------------------------------------------------------
+// This file is part of PlaQui.
+//
+// PlaQui is free software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the Free Software
+// Foundation; either version 2 of the License, or (at your option) any later
+// version.
+//
+// PlaQui is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General Public License along
+// with PlaQui; if not, write to the Free Software Foundation, Inc., 59 Temple
+// Place, Suite 330, Boston, MA  02111-1307  USA
+//----------------------------------------------------------------------------
+// Creado:  Tue Oct 21 20:43:04 ART 2003
+// Autores: Leandro Lucarella <llucare@fi.uba.ar>
+//----------------------------------------------------------------------------
+//
+// $Id$
+//
+
+#ifndef PLAQUI_SERVERCONNECTION_H
+#define PLAQUI_SERVERCONNECTION_H
+
+#include "plaqui/server/connection.h"
+#include <sigc++/signal.h>
+#include <socket++/sockinet.h>
+
+namespace PlaQui {
+
+namespace Server {
+
+       /// Conexión de un servidor.
+       class ServerConnection: public Connection {
+
+               // Tipos.
+
+               public:
+
+                       /// Tipo de señal para indicar que se recibió un comando.
+                       // FIXME - poner un tipo Command que sea padre de todos los
+                       // comandos.
+                       typedef SigC::Signal1<void, void*> SignalCommandReceived;
+
+               // Atributos.
+
+               private:
+
+                       /// Señal que indica que se recibió un comando.
+                       SignalCommandReceived command_received;
+
+               // Métodos.
+
+               public:
+
+                       /**
+                        * Destructor.
+                        */
+                       virtual ~ServerConnection(void) {}
+
+                       /**
+                        * Obtiene la señal que avisa que se recibió un comando.
+                        */
+                       SignalCommandReceived& signal_command_received(void);
+
+       };
+
+}
+
+}
+
+#endif // PLAQUI_SERVERCONNECTION_H 
diff --git a/Server/src/serverconnection.cpp b/Server/src/serverconnection.cpp
new file mode 100644 (file)
index 0000000..5e159c3
--- /dev/null
@@ -0,0 +1,59 @@
+// vim: set noexpandtab tabstop=4 shiftwidth=4:
+//----------------------------------------------------------------------------
+//                                  PlaQui
+//----------------------------------------------------------------------------
+// This file is part of PlaQui.
+//
+// PlaQui is free software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the Free Software
+// Foundation; either version 2 of the License, or (at your option) any later
+// version.
+//
+// PlaQui is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General Public License along
+// with PlaQui; if not, write to the Free Software Foundation, Inc., 59 Temple
+// Place, Suite 330, Boston, MA  02111-1307  USA
+//----------------------------------------------------------------------------
+// Creado:  Wed Oct 22 00:06:06 ART 2003
+// Autores: Leandro Lucarella <llucare@fi.uba.ar>
+//----------------------------------------------------------------------------
+//
+// $Id$
+//
+
+#include "plaqui/server/serverconnection.h"
+#include <socket++/sockinet.h>
+#ifdef DEBUG
+#      include <iostream>
+#endif // DEBUG
+
+PlaQui::Server::ServerConnection::~ServerConnection(void) {
+#ifdef DEBUG
+       std::cerr << __FILE__ << ": destructor." << std::endl;
+#endif // DEBUG
+}
+
+/*
+PlaQui::Server::ServerConnection::ServerConnection(const sockbuf::sockdesc& sd):
+               socket(sd) {
+#ifdef DEBUG
+       std::cerr << __FILE__ << ": sd = " << sd.sock << std::endl;
+#endif // DEBUG
+}
+
+PlaQui::Server::ServerConnection::ServerConnection(sockbuf::type type):
+               socket(type) {
+#ifdef DEBUG
+       std::cerr << __FILE__ << ": type = " << type << std::endl;
+#endif // DEBUG
+}
+*/
+
+PlaQui::Server::ServerConnection::SignalCommandReceived&
+PlaQui::Server::ServerConnection::signal_command_received(void) {
+       return command_received;
+}