From e6d0648eb6af32d0e8db4876430f20dcc7d8d920 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 22 Oct 2003 04:00:16 +0000 Subject: [PATCH] Archivos para la nueva implementacion del server. --- .../include/plaqui/server/serverconnection.h | 78 +++++++++++++++++++ Server/src/serverconnection.cpp | 59 ++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 Server/include/plaqui/server/serverconnection.h create mode 100644 Server/src/serverconnection.cpp diff --git a/Server/include/plaqui/server/serverconnection.h b/Server/include/plaqui/server/serverconnection.h new file mode 100644 index 0000000..91fa37f --- /dev/null +++ b/Server/include/plaqui/server/serverconnection.h @@ -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 +//---------------------------------------------------------------------------- +// +// $Id$ +// + +#ifndef PLAQUI_SERVERCONNECTION_H +#define PLAQUI_SERVERCONNECTION_H + +#include "plaqui/server/connection.h" +#include +#include + +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 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 index 0000000..5e159c3 --- /dev/null +++ b/Server/src/serverconnection.cpp @@ -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 +//---------------------------------------------------------------------------- +// +// $Id$ +// + +#include "plaqui/server/serverconnection.h" +#include +#ifdef DEBUG +# include +#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; +} -- 2.43.0