ClienteTFG/conexion.h
2020-06-01 23:24:24 +02:00

35 lines
727 B
C++

#ifndef CONEXION_H
#define CONEXION_H
#include "config_reader.h"
class conexion
{
public:
/**
* @brief conexion
* Create a conexion
* @param conf Config file to give the parameters of conexion
*/
conexion(config_reader &conf);
/**
* @brief read_string
* Read a string in the socket
* @param input String readed
* @param size Length to read
* @return Size of bytes readed
*/
virtual ssize_t read_string(std::string &input, int size);
/**
* @brief write_string
* Write a sitring in the socket
* @param output String to send
* @return bytes sended
*/
virtual ssize_t write_string(std::string output);
protected:
config_reader *config;
int fd;
};
#endif // CONEXION_H