X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/292425c2f65528535f137b437e629c5785c870d0..34fb46485db0fb44f8dcc532866d988f8e54caa2:/Server/include/plaqui/server/tcpserver.h?ds=sidebyside diff --git a/Server/include/plaqui/server/tcpserver.h b/Server/include/plaqui/server/tcpserver.h index 393f4cc..1cd344f 100644 --- a/Server/include/plaqui/server/tcpserver.h +++ b/Server/include/plaqui/server/tcpserver.h @@ -32,6 +32,7 @@ #include "plaqui/server/connection.h" #include #include +#include namespace PlaQui { @@ -43,16 +44,33 @@ namespace Server { */ class TCPServer: public Runnable { - // Tipos. + // Constantes. private: /// Cantidad máxima de conexiones pendientes. - static const unsigned MAX_PENDING_CONNECTIONS; + static const unsigned MAX_PENDING_CONNECTIONS = 10; + + // Tipos. + + private: /// Lista de conexiones de control. typedef std::list ConnectionList; + public: + + /// Información sobre una conexión de contro. + struct ConnectionInfo { + /// Host. + std::string host; + /// Port. + unsigned port; + }; + + /// Lista de información de conexiones de control. + typedef std::vector ConnectionInfoList; + // Atributos. private: @@ -107,6 +125,11 @@ namespace Server { */ void on_connection_finished(Connection* connection); + /** + * Obtiene una lista conexiones de control abiertas. + */ + ConnectionInfoList get_connected(void); + }; }