From 5efcb3f7dec0d284aa89d5fc179de70d0405b52c Mon Sep 17 00:00:00 2001
From: shys <shyswork@zoho.com>
Date: Fri, 25 Oct 2013 15:49:11 +0200
Subject: [PATCH] Subject: [PATCH] Additional check for EISONN. On iOS "if
 (connect()) == -1 ||  errno == EISCONN)" doesn't work.

---
 lib/client-handshake.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/client-handshake.c b/lib/client-handshake.c
index a241c90c..83d8f21d 100644
--- a/lib/client-handshake.c
+++ b/lib/client-handshake.c
@@ -93,8 +93,11 @@ struct libwebsocket *__libwebsocket_client_connect_2(
 			return wsi;
 		}
 
-		lwsl_debug("Connect failed errno=%d\n", errno);
-		goto failed;
+		if (errno != EISCONN) {
+		
+			lwsl_debug("Connect failed errno=%d\n", errno);
+			goto failed;
+		}
 	}
 
 	lwsl_client("connected\n");
-- 
GitLab