generated from AfonsoCMSousa/CPP-Template
fix: finnaly working!
This commit is contained in:
+12
-4
@@ -21,6 +21,10 @@ class Socket {
|
||||
struct sockaddr_in server_addr;
|
||||
struct sockaddr_un server_addr_unix;
|
||||
|
||||
// Server port for input (listening)
|
||||
int server_port_input;
|
||||
char buffer[1024];
|
||||
|
||||
// Socket Data
|
||||
api_packet packet_data;
|
||||
|
||||
@@ -28,15 +32,19 @@ class Socket {
|
||||
Socket();
|
||||
~Socket();
|
||||
|
||||
void connect_server(const char *ip, uint16_t port);
|
||||
void connect_unix(const char *ip, uint16_t port);
|
||||
void connect_server(const char *ip, uint16_t port, uint16_t port_input);
|
||||
void send_server();
|
||||
void send_unix();
|
||||
void send_server(const api_packet &data);
|
||||
void send_server(const void *data, size_t len);
|
||||
void receive_server();
|
||||
char *get_buffer() { return buffer; }
|
||||
|
||||
void connect_unix(const char *ip, uint16_t port);
|
||||
void send_unix();
|
||||
void send_unix(const api_packet &data);
|
||||
void set_packet(const api_packet &data);
|
||||
api_packet create_packet(uint8_t tracker_id);
|
||||
|
||||
api_packet create_packet(uint8_t tracker_id);
|
||||
api_packet get_packet();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user