First Commit, not finished
This commit is contained in:
38
Connection.h
Normal file
38
Connection.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef CONNECTION_H
|
||||
#define CONNECTION_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class Payload; //TODO
|
||||
|
||||
class Connection
|
||||
{
|
||||
private:
|
||||
int fd;
|
||||
|
||||
enum class ErrorTypes{
|
||||
none = 0,
|
||||
|
||||
socket_creation = 10,
|
||||
get_ip,
|
||||
connect,
|
||||
}error;
|
||||
|
||||
void p_HandleError();
|
||||
|
||||
public:
|
||||
Connection(std::string server_ip, int port);
|
||||
~Connection();
|
||||
|
||||
bool send(std::vector<Payload> payload);
|
||||
bool recv(void* data, int size);
|
||||
|
||||
/**
|
||||
* Return the error code from the last command if there is one
|
||||
* @return error_code
|
||||
*/
|
||||
int status();
|
||||
};
|
||||
|
||||
#endif /* CONNECTION_H */
|
||||
Reference in New Issue
Block a user