From 549f23afd8a430df856dd6f99351a1b649aca3d7 Mon Sep 17 00:00:00 2001 From: steffen Date: Sun, 3 Feb 2019 20:31:08 +0000 Subject: [PATCH] fixeing connection problems.. --- Changelog | 3 +++ tcp.cc | 1 + 2 files changed, 4 insertions(+) diff --git a/Changelog b/Changelog index d5d496e..d31324f 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,6 @@ +2019-02-03: +- fixed: if connection could not established we need to clear sock to -1 + 2019-01-30: - Adding unix socket to the possible connections diff --git a/tcp.cc b/tcp.cc index e7f899c..66e500d 100644 --- a/tcp.cc +++ b/tcp.cc @@ -180,6 +180,7 @@ int TCP::Connect() { if (sock == -1) continue; if (connect(sock, rp->ai_addr, rp->ai_addrlen) != -1) break; close(sock); + sock = -1; } freeaddrinfo(res);