]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Server/include/plaqui/server/tcpserver.h
Se mueve el mutex a la clase que tiene el recurso a proteger.
[z.facultad/75.42/plaqui.git] / Server / include / plaqui / server / tcpserver.h
index b37984428858668a09da3b2a4a7c0486496d0280..393f4cc4040f4e82ebb80bac2e6aa6e842e10432 100644 (file)
 #ifndef PLAQUI_TCPSERVER_H
 #define PLAQUI_TCPSERVER_H
 
 #ifndef PLAQUI_TCPSERVER_H
 #define PLAQUI_TCPSERVER_H
 
-#include "plaqui/server/controlserver.h"
-#include "plaqui/server/transmitter.h"
+#include "plaqui/server/runnable.h"
+#include "plaqui/server/connection.h"
 #include <socket++/sockinet.h>
 #include <socket++/sockinet.h>
-#include <string>
 #include <list>
 
 namespace PlaQui {
 #include <list>
 
 namespace PlaQui {
@@ -48,8 +47,11 @@ namespace Server {
 
                private:
 
 
                private:
 
+                       /// Cantidad máxima de conexiones pendientes.
+                       static const unsigned MAX_PENDING_CONNECTIONS;
+
                        /// Lista de conexiones de control.
                        /// Lista de conexiones de control.
-                       typedef std::list<Connnection*> ConnectionList;
+                       typedef std::list<Connection*> ConnectionList;
 
                // Atributos.
 
 
                // Atributos.
 
@@ -58,6 +60,9 @@ namespace Server {
                        /// Socket para escuchar conexiones.
                        sockinetbuf socket;
 
                        /// Socket para escuchar conexiones.
                        sockinetbuf socket;
 
+                       /// Mutex para las conexiones.
+                       Glib::Mutex connections_mutex;
+
                        /// Conexiones de control.
                        ConnectionList connections;
 
                        /// Conexiones de control.
                        ConnectionList connections;
 
@@ -86,7 +91,7 @@ namespace Server {
                        /**
                         * Destructor.
                         */
                        /**
                         * Destructor.
                         */
-                       virtual ~TCPServer(void) {}
+                       virtual ~TCPServer(void);
 
                        /**
                         * Constructor.
 
                        /**
                         * Constructor.