2020-05-08 12:43:46 +02:00
|
|
|
#ifndef CONEXION_H
|
|
|
|
#define CONEXION_H
|
|
|
|
#include <string>
|
|
|
|
#include "config_reader.h"
|
|
|
|
#include "data_acces.h"
|
|
|
|
using namespace std;
|
|
|
|
class conexion
|
|
|
|
{
|
|
|
|
public:
|
2020-06-01 23:23:23 +02:00
|
|
|
/**
|
|
|
|
* @brief conexion
|
|
|
|
* Object that launch the server and start the sessions
|
|
|
|
* @param conf Configuration file
|
|
|
|
*/
|
|
|
|
conexion(config_reader &conf);
|
|
|
|
/**
|
|
|
|
* @brief start_server
|
|
|
|
* Start the server
|
|
|
|
*/
|
|
|
|
virtual void start_server();
|
2020-05-08 12:43:46 +02:00
|
|
|
protected:
|
2020-06-01 23:23:23 +02:00
|
|
|
data_acces* data;
|
|
|
|
/**
|
|
|
|
* @brief create_socket
|
|
|
|
* Create the server socket
|
|
|
|
* @param port Port to listen the server
|
|
|
|
* @return File descritor to listen the new conexions
|
|
|
|
*/
|
|
|
|
int create_socket(int port);
|
|
|
|
config_reader* config;
|
2020-05-08 12:43:46 +02:00
|
|
|
};
|
|
|
|
#endif // CONEXION_H
|