]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
Primer esqueleto de las clases cliente/servidor.
authorLeandro Lucarella <llucax@gmail.com>
Sun, 19 Oct 2003 00:26:09 +0000 (00:26 +0000)
committerLeandro Lucarella <llucax@gmail.com>
Sun, 19 Oct 2003 00:26:09 +0000 (00:26 +0000)
14 files changed:
Server/src/Makefile [new file with mode: 0644]
Server/src/connection.cpp [new file with mode: 0644]
Server/src/connection.h [new file with mode: 0644]
Server/src/controlclient.cpp [new file with mode: 0644]
Server/src/controlclient.h [new file with mode: 0644]
Server/src/controlserver.cpp [new file with mode: 0644]
Server/src/controlserver.h [new file with mode: 0644]
Server/src/receiver.cpp [new file with mode: 0644]
Server/src/receiver.h [new file with mode: 0644]
Server/src/runnable.h [new file with mode: 0644]
Server/src/server.cpp [new file with mode: 0644]
Server/src/server.h [new file with mode: 0644]
Server/src/transmitter.cpp [new file with mode: 0644]
Server/src/transmitter.h [new file with mode: 0644]

diff --git a/Server/src/Makefile b/Server/src/Makefile
new file mode 100644 (file)
index 0000000..146f7a8
--- /dev/null
@@ -0,0 +1,56 @@
+# 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:  sáb oct 18 21:24:06 ART 2003
+# Autores: Leandro Lucarella <llucare@fi.uba.ar>
+#----------------------------------------------------------------------------
+#
+# $Id$
+#
+
+# Opciones para el compilador.
+CXXFLAGS=-ansi -pedantic -Wall -g
+LDFLAGS=-lsocket++
+
+TARGETS=connection.o controlclient.o controlserver.o receiver.o transmitter.o \
+       server.o
+
+# Regla por defecto.
+all: $(TARGETS)
+
+runnable_h=runnable.h
+
+connection_h=$(runnable_h) connection.h
+connection.o: $(connection_h)
+
+controlclient_h=$(connection_h) controlclient.h
+controlclient.o: $(controlclient_h)
+
+controlserver_h=$(connection_h) controlserver.h
+controlserver.o: $(controlserver_h)
+
+receiver_h=$(connection_h) receiver.h
+receiver.o: $(receiver_h)
+
+transmitter_h=$(connection_h) transmitter.h
+transmitter.o: $(transmitter_h)
+
+clean:
+       rm -f $(TARGETS) *.o
diff --git a/Server/src/connection.cpp b/Server/src/connection.cpp
new file mode 100644 (file)
index 0000000..086548a
--- /dev/null
@@ -0,0 +1,40 @@
+// 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:  Sat Oct 18 18:18:36 2003
+// Autores: Leandro Lucarella <llucare@fi.uba.ar>
+//----------------------------------------------------------------------------
+//
+// $Id$
+//
+
+#include "connection.h"
+#include <socket++/sockinet.h>
+
+using namespace Plaqui;
+
+Connection::Connection(const sockinetbuf& sb):
+               socket(sb) {
+}
+
+Connection::Connection(sockbuf::type type):
+               socket(type) {
+}
+
diff --git a/Server/src/connection.h b/Server/src/connection.h
new file mode 100644 (file)
index 0000000..306e273
--- /dev/null
@@ -0,0 +1,69 @@
+// 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:  Sat Oct 18 18:18:36 2003
+// Autores: Leandro Lucarella <llucare@fi.uba.ar>
+//----------------------------------------------------------------------------
+//
+// $Id$
+//
+
+#ifndef PLAQUI_CONNECTION_H
+#define PLAQUI_CONNECTION_H
+
+#include "runnable.h"
+#include <socket++/sockinet.h>
+
+namespace Plaqui {
+
+       /// Conexión.
+       class Connection: public Runnable {
+
+               protected:
+
+                       /// Socket a usar en la conexión.
+                       iosockinet socket;
+
+               public:
+
+                       /**
+                        * Destructor.
+                        */
+                       virtual ~Connection(void) {}
+
+                       /**
+                        * Constructor.
+                        *
+                        * \param socket Socket a usar en la conexión.
+                        */
+                       Connection(const sockinetbuf& sb);
+
+                       /**
+                        * Constructor.
+                        *
+                        * \param type Tipo de socket a usar.
+                        */
+                       Connection(sockbuf::type type);
+
+       };
+
+}
+
+#endif // PLAQUI_CONNECTION_H 
diff --git a/Server/src/controlclient.cpp b/Server/src/controlclient.cpp
new file mode 100644 (file)
index 0000000..3ad35f8
--- /dev/null
@@ -0,0 +1,36 @@
+// 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:  Sat Oct 18 18:18:36 2003
+// Autores: Leandro Lucarella <llucare@fi.uba.ar>
+//----------------------------------------------------------------------------
+//
+// $Id$
+//
+
+#include "controlclient.h"
+
+using namespace Plaqui;
+
+ControlClient::ControlClient(std::string host, int port):
+               Connection(sockbuf::sock_stream) {
+       socket->connect(host.c_str(), port);
+}
+
diff --git a/Server/src/controlclient.h b/Server/src/controlclient.h
new file mode 100644 (file)
index 0000000..ce32d86
--- /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:  Sat Oct 18 18:18:36 2003
+// Autores: Leandro Lucarella <llucare@fi.uba.ar>
+//----------------------------------------------------------------------------
+//
+// $Id$
+//
+
+#ifndef PLAQUI_CONTROLCLIENT_H
+#define PLAQUI_CONTROLCLIENT_H
+
+#include "connection.h"
+#include <string>
+
+namespace Plaqui {
+
+       /// Conexión para enviar comandos de control a una planta.
+       class ControlClient: public Connection {
+
+               public:
+
+                       /**
+                        * Destructor.
+                        */
+                       virtual ~ControlClient(void) {}
+
+                       /**
+                        * Constructor.
+                        *
+                        * \param host Host al cual conectarse para enviar comandos de
+                        *                         control.
+                        * \param port Puerto al cual conectarse.
+                        */
+                       ControlClient(std::string host = "localhost", int port = 7522);
+
+       };
+
+}
+
+#endif // PLAQUI_CONTROLCLIENT_H
diff --git a/Server/src/controlserver.cpp b/Server/src/controlserver.cpp
new file mode 100644 (file)
index 0000000..c9007c5
--- /dev/null
@@ -0,0 +1,34 @@
+// 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:  Sat Oct 18 18:18:36 2003
+// Autores: Leandro Lucarella <llucare@fi.uba.ar>
+//----------------------------------------------------------------------------
+//
+// $Id$
+//
+
+#include "controlserver.h"
+
+using namespace Plaqui;
+
+//ControlServer::ControlServer(const iosockinet& socket) {
+//}
+
diff --git a/Server/src/controlserver.h b/Server/src/controlserver.h
new file mode 100644 (file)
index 0000000..c973134
--- /dev/null
@@ -0,0 +1,58 @@
+// 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:  Sat Oct 18 18:18:36 2003
+// Autores: Leandro Lucarella <llucare@fi.uba.ar>
+//----------------------------------------------------------------------------
+//
+// $Id$
+//
+
+#ifndef PLAQUI_CONTROLSERVER_H
+#define PLAQUI_CONTROLSERVER_H
+
+#include "connection.h"
+#include <socket++/sockinet.h>
+
+namespace Plaqui {
+
+       /// Conexión para recibir comandos de control para una planta.
+       class ControlServer: public Connection {
+
+               public:
+
+                       /**
+                        * Destructor.
+                        */
+                       virtual ~ControlServer(void) {}
+
+                       /**
+                        * Constructor.
+                        *
+                        * \param socket  Socket a usar para recibir comandos.
+                        */
+                       ControlServer(const sockinetbuf& socket): Connection(socket) {}
+
+       };
+
+}
+
+
+#endif // PLAQUI_CONTROLSERVER_H
diff --git a/Server/src/receiver.cpp b/Server/src/receiver.cpp
new file mode 100644 (file)
index 0000000..172a19f
--- /dev/null
@@ -0,0 +1,35 @@
+// 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:  Sat Oct 18 18:18:36 2003
+// Autores: Leandro Lucarella <llucare@fi.uba.ar>
+//----------------------------------------------------------------------------
+//
+// $Id$
+//
+
+#include "receiver.h"
+
+/*
+Receiver::Receiver(int port, std::string host): Connection(sockbuf::dgram) {
+       socket->bind(port);
+}
+*/
+
diff --git a/Server/src/receiver.h b/Server/src/receiver.h
new file mode 100644 (file)
index 0000000..8be4e30
--- /dev/null
@@ -0,0 +1,60 @@
+// 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:  Sat Oct 18 18:18:36 2003
+// Autores: Leandro Lucarella <llucare@fi.uba.ar>
+//----------------------------------------------------------------------------
+//
+// $Id$
+//
+
+#ifndef PLAQUI_RECEIVER_H
+#define PLAQUI_RECEIVER_H
+
+#include "connection.h"
+#include <socket++/sockinet.h>
+#include <string>
+
+namespace Plaqui {
+
+       /// Conexión para recibir el estado de una planta.
+       class Receiver: public Connection {
+
+               public:
+
+                       /**
+                        * Destructor.
+                        */
+                       virtual ~Receiver(void) {}
+
+                       /**
+                        * Constructor.
+                        *
+                        * \param port Puerto por el cual recibir estado de la planta.
+                        * \param host Host del cual recibir el estado de la planta.
+                        */
+                       Receiver(int port = 7528 /*, std::string host = "localhost"*/):
+                               Connection(sockbuf::sock_dgram) { socket->bind(port); }
+
+       };
+
+}
+
+#endif // PLAQUI_RECEIVER_H
diff --git a/Server/src/runnable.h b/Server/src/runnable.h
new file mode 100644 (file)
index 0000000..04cb094
--- /dev/null
@@ -0,0 +1,45 @@
+// 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:  Sat Oct 18 20:55:08 2003
+// Autores: Leandro Lucarella <llucare@fi.uba.ar>
+//----------------------------------------------------------------------------
+//
+// $Id$
+//
+
+#ifndef PLAQUI_RUNNABLE_H
+#define PLAQUI_RUNNABLE_H
+
+namespace Plaqui {
+
+       /// ealizauna tarea (generalmente en un thread).
+       class Runnable {
+
+               public:
+
+                       /// Realiza la tarea.
+                       virtual void run(void) = 0;
+
+       };
+
+}
+
+#endif // PLAQUI_RUNNABLE_H
diff --git a/Server/src/server.cpp b/Server/src/server.cpp
new file mode 100644 (file)
index 0000000..bbf41c0
--- /dev/null
@@ -0,0 +1,49 @@
+// 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:  Sat Oct 18 18:18:36 2003
+// Autores: Leandro Lucarella <llucare@fi.uba.ar>
+//----------------------------------------------------------------------------
+//
+// $Id$
+//
+
+#include "server.h"
+
+using namespace Plaqui;
+
+Server::Server(int port):
+               socket(sockbuf::sock_stream) {
+#warning Not implemented!
+       // TODO
+}
+
+bool Server::start_transmission(std::string host, int port) {
+#warning Not implemented!
+       // TODO
+       return false;
+}
+
+bool Server::stop_transmission(std::string host, int port) {
+#warning Not implemented!
+       // TODO
+       return false;
+}
+
diff --git a/Server/src/server.h b/Server/src/server.h
new file mode 100644 (file)
index 0000000..ccd2c0e
--- /dev/null
@@ -0,0 +1,110 @@
+// 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:  Sat Oct 18 18:18:36 2003
+// Autores: Leandro Lucarella <llucare@fi.uba.ar>
+//----------------------------------------------------------------------------
+//
+// $Id$
+//
+
+#ifndef PLAQUI_SERVER_H
+#define PLAQUI_SERVER_H
+
+#include "controlserver.h"
+#include "transmitter.h"
+#include <socket++/sockinet.h>
+#include <string>
+#include <list>
+
+namespace Plaqui {
+
+       /**
+        * Servidor de plantas químicas.
+        * Maneja muchas conexiones, de control o de transmisión.
+        */
+       class Server: public Runnable {
+
+               private:
+
+                       /// Lista de conexiones de control.
+                       typedef std::list<ControlServer*> ControllerList;
+
+                       /// Lista de conexiones de control.
+                       typedef std::list<Transmitter*> TransmitterList;
+
+                       /// Socket para escuchar conexiones.
+                       sockbuf socket;
+
+                       /// Conexiones de control.
+                       ControllerList controllers;
+
+                       /// Transmisiones del estado de las plantas.
+                       TransmitterList transmissions;
+
+               public:
+
+                       /**
+                        * Destructor.
+                        */
+                       virtual ~Server(void) {}
+
+                       /**
+                        * Constructor.
+                        *
+                        * \param port Puerto en el cual escuchar.
+                        */
+                       Server(int port = 7522);
+
+                       /**
+                        * Comienza la transimisión del estado de una planta.
+                        *
+                        * \param host Host al cual se quiere transmitir.
+                        * \param port Puerto al cual transmitir.
+                        *
+                        * \return true si se pudo empezar a transmitir, false si no.
+                        *
+                        * \todo Ver si es necesario que devuelva algo y si devuelve ver si
+                        *       no sería mejor que dé más información (si no se pudo abrir
+                        *       o si ya estaba abierto por ejemplo.
+                        */
+                       bool start_transmission(std::string host = "localhost",
+                                       int port = 7528);
+
+                       /**
+                        * Finaliza la transimisión del estado de una planta.
+                        *
+                        * \param host Host al cual se quiere dejar de transmitir.
+                        * \param port Puerto al cual dejar de transmitir.
+                        *
+                        * \return true si se pudo empezar a transmitir, false si no.
+                        *
+                        * \todo Ver si es necesario que devuelva algo y si devuelve ver si
+                        *       no sería mejor que dé más información (si no se pudo abrir
+                        *       o si ya estaba abierto por ejemplo.
+                        */
+                       bool stop_transmission(std::string host = "localhost",
+                                       int port = 7528);
+
+       };
+
+}
+
+#endif // PLAQUI_SERVER_H
diff --git a/Server/src/transmitter.cpp b/Server/src/transmitter.cpp
new file mode 100644 (file)
index 0000000..b8635fa
--- /dev/null
@@ -0,0 +1,39 @@
+// 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:  Sat Oct 18 18:18:36 2003
+// Autores: Leandro Lucarella <llucare@fi.uba.ar>
+//----------------------------------------------------------------------------
+//
+// $Id$
+//
+
+#include "transmitter.h"
+#include <socket++/sockinet.h>
+#include <string>
+
+using namespace Plaqui;
+
+Transmitter::Transmitter(std::string host, int port):
+               Connection(sockbuf::sock_dgram) {
+#warning Not implemented!
+       socket->connect(host.c_str(), port);
+}
+
diff --git a/Server/src/transmitter.h b/Server/src/transmitter.h
new file mode 100644 (file)
index 0000000..2100c1f
--- /dev/null
@@ -0,0 +1,58 @@
+// 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:  Sat Oct 18 18:18:36 2003
+// Autores: Leandro Lucarella <llucare@fi.uba.ar>
+//----------------------------------------------------------------------------
+//
+// $Id$
+//
+
+#ifndef PLAQUI_TRANSMITTER_H
+#define PLAQUI_TRANSMITTER_H
+
+#include "connection.h"
+#include <string>
+
+namespace Plaqui {
+
+       /// Conexión para transmitir el estado de una planta.
+       class Transmitter: public Connection {
+
+               public:
+
+                       /**
+                        * Destructor.
+                        */
+                       virtual ~Transmitter(void) {}
+
+                       /**
+                        * Constructor.
+                        *
+                        * \param host Host al cual transmitir.
+                        * \param port Puerto al cual transmitir.
+                        */
+                       Transmitter(std::string host = "localhost", int port = 7528);
+
+       };
+
+}
+
+#endif // PLAQUI_TRANSMITTER_H