generated from AfonsoCMSousa/CPP-Template
fix: fixed more net.cpp problems
This commit is contained in:
+8
-3
@@ -6,6 +6,7 @@
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "server_structs.h"
|
||||
@@ -17,6 +18,7 @@ class Socket {
|
||||
// Socket file descriptor
|
||||
int sock;
|
||||
struct sockaddr_in server_addr;
|
||||
struct sockaddr_un server_addr_unix;
|
||||
|
||||
// Socket Data
|
||||
api_packet packet_data;
|
||||
@@ -25,9 +27,12 @@ class Socket {
|
||||
Socket();
|
||||
~Socket();
|
||||
|
||||
void connect(const char *ip, uint16_t port);
|
||||
void send();
|
||||
void send(const api_packet &data);
|
||||
void connect_server(const char *ip, uint16_t port);
|
||||
void connect_unix(const char *ip, uint16_t port);
|
||||
void send_server();
|
||||
void send_unix();
|
||||
void send_server(const api_packet &data);
|
||||
void send_unix(const api_packet &data);
|
||||
void set_packet(const api_packet &data);
|
||||
api_packet create_packet(uint8_t tracker_id);
|
||||
api_packet get_packet();
|
||||
|
||||
Reference in New Issue
Block a user