From: xiehang Date: Thu, 21 Feb 2019 08:25:07 +0000 (+0800) Subject: fix the bug in tcp_client X-Git-Tag: v3.3-beta2~10^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e8b8d91a50d30ead93d54114710012657a60708;p=esp-idf fix the bug in tcp_client Closes https://github.com/espressif/esp-idf/issues/3058 --- diff --git a/examples/protocols/sockets/tcp_client/main/tcp_client.c b/examples/protocols/sockets/tcp_client/main/tcp_client.c index 9faaa8c655..1d2486184a 100644 --- a/examples/protocols/sockets/tcp_client/main/tcp_client.c +++ b/examples/protocols/sockets/tcp_client/main/tcp_client.c @@ -147,6 +147,7 @@ static void tcp_client_task(void *pvParameters) int err = connect(sock, (struct sockaddr *)&destAddr, sizeof(destAddr)); if (err != 0) { ESP_LOGE(TAG, "Socket unable to connect: errno %d", errno); + break; } ESP_LOGI(TAG, "Successfully connected");