generated from AfonsoCMSousa/CPP-Template
fix: finnaly working!
This commit is contained in:
parent
2f4f46a77b
commit
6e4ed57e8a
BIN
PlayerTracker
BIN
PlayerTracker
Binary file not shown.
@ -30,6 +30,11 @@ int main(int argc, char *argv[]) {
|
|||||||
request[1] = 120;
|
request[1] = 120;
|
||||||
|
|
||||||
sock.send_server(request, sizeof(request));
|
sock.send_server(request, sizeof(request));
|
||||||
|
cout << "[+] Connected to server!\n\tInfo: " << endl;
|
||||||
|
cout << "\t- API Socket Path: " << app.app_api_socket_path << endl;
|
||||||
|
cout << "\t- Server Out IP: " << app.app_server_out_ip << endl;
|
||||||
|
cout << "\t- App Port In: " << app.app_port_in << endl;
|
||||||
|
cout << "\t- App Port Out: " << app.app_port_out << endl;
|
||||||
|
|
||||||
} catch (const runtime_error &e) {
|
} catch (const runtime_error &e) {
|
||||||
cerr << "Error: " << e.what() << endl;
|
cerr << "Error: " << e.what() << endl;
|
||||||
|
|||||||
@ -34,8 +34,6 @@ void Socket::connect_unix(const char *ip, uint16_t port) {
|
|||||||
this->server_addr_unix.sun_family = AF_UNIX;
|
this->server_addr_unix.sun_family = AF_UNIX;
|
||||||
strncpy(this->server_addr_unix.sun_path, ip, sizeof(this->server_addr_unix.sun_path) - 1);
|
strncpy(this->server_addr_unix.sun_path, ip, sizeof(this->server_addr_unix.sun_path) - 1);
|
||||||
|
|
||||||
printf("Connecting to UNIX socket at %s\n", ip);
|
|
||||||
|
|
||||||
if (connect(sock_unix, (struct sockaddr *)&server_addr_unix, sizeof(server_addr_unix)) < 0) {
|
if (connect(sock_unix, (struct sockaddr *)&server_addr_unix, sizeof(server_addr_unix)) < 0) {
|
||||||
throw std::runtime_error("Failed to connect to UNIX socket");
|
throw std::runtime_error("Failed to connect to UNIX socket");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user