con timeout

This commit is contained in:
2026-05-15 19:28:21 +02:00
parent 0fb2615d4c
commit 9405801f6b
2 changed files with 52 additions and 4 deletions
+6 -1
View File
@@ -11,6 +11,7 @@
#include <signal.h>
#include <balance_sheet.h>
#include <unistd.h>
#include <errno.h>
#include <constants.h>
@@ -1059,7 +1060,11 @@ int main(int argc, char* argv[]) {
}
if (Node_ConnectPeer(node, ipStr, LISTEN_PORT) != 0) {
printf("failed to connect to %s:%u\n", ipStr, (unsigned int)LISTEN_PORT);
if (errno == ETIMEDOUT) {
printf("failed to connect to %s:%u (timeout)\n", ipStr, (unsigned int)LISTEN_PORT);
} else {
printf("failed to connect to %s:%u\n", ipStr, (unsigned int)LISTEN_PORT);
}
continue;
}