From 5e7aa014fc2d7837e781495163689e831e9c5b63 Mon Sep 17 00:00:00 2001 From: AfonsoCMSousa Date: Wed, 7 Jan 2026 22:02:11 +0000 Subject: [PATCH] fix: fixed ANOTHER issue with net.cpp --- source/net.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/net.cpp b/source/net.cpp index 35e1730..2aef392 100644 --- a/source/net.cpp +++ b/source/net.cpp @@ -25,15 +25,20 @@ void Socket::connect_server(const char *ip, uint16_t port) { void Socket::connect_unix(const char *ip, uint16_t port) { sock = socket(AF_UNIX, SOCK_STREAM, 0); if (sock < 0) { + perror("socket() Failed"); throw std::runtime_error("Failed to create UNIX socket"); } this->server_addr_unix.sun_family = AF_UNIX; 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, (struct sockaddr *)&server_addr_unix, sizeof(server_addr_unix)) < 0) { throw std::runtime_error("Failed to connect to UNIX socket"); } + + printf("Connected to UNIX socket at %s\n", ip); } void Socket::send_server() {