]> granicus.if.org Git - esp-idf/commitdiff
fix the bug in tcp_client
authorxiehang <xiehang@espressif.com>
Thu, 21 Feb 2019 08:25:07 +0000 (16:25 +0800)
committerbot <bot@espressif.com>
Tue, 26 Feb 2019 09:28:17 +0000 (09:28 +0000)
Closes https://github.com/espressif/esp-idf/issues/3058

examples/protocols/sockets/tcp_client/main/tcp_client.c

index 9faaa8c6558e1a6226691759b66dab6bd536867b..1d2486184a49242cd3ab63ccb574bbe2f06bf6e5 100644 (file)
@@ -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");