if (sock != -1)
{
ESP_LOGE(TAG, "Shutting down socket and restarting...");
shutdown(sock, 0);
close(sock);
shutdown(listen_sock,0);
close(listen_sock);
vTaskDelay(5);
}
Search found 2 matches
- Sat Jul 27, 2019 8:58 am
- Forum: General Discussion
- Topic: tcp_server example not able to reconnect the server after disconnect
- Replies: 25
- Views: 36780
- Sat Jul 27, 2019 8:53 am
- Forum: ESP-IDF
- Topic: tcp_server.c -> Socket unable to bind: errno 112
- Replies: 2
- Views: 6709
Re: tcp_server.c -> Socket unable to bind: errno 112
while(1) { ........ while(1) { } if (sock != -1) { ESP_LOGE(TAG, "Shutting down socket and restarting..."); shutdown(sock, 0); close(sock); shutdown(listen_sock,0); close(listen_sock); vTaskDelay(5); } }