Page 1 of 1

tcp_server.c -> Socket unable to bind: errno 112

Posted: Mon Apr 29, 2019 2:14 pm
by adam_esp
Hello,
a problem with the server's operation after the host has closed the sockets:
[0;32mI (10366) TestHeap: Free Heap size: 217464[0m
[0;32mI (11196) example: Socket accepted[0m
[0;32mI (11366) TestHeap: Free Heap size: 217504[0m
[0;32mI (12366) TestHeap: Free Heap size: 217504[0m
[0;32mI (13366) TestHeap: Free Heap size: 217504[0m
[0;32mI (13746) example: Connection closed[0m
[0;31mE (13756) example: Shutting down socket and restarting...[0m
[0;32mI (13756) example: Socket created[0m
[0;31mE (13756) example: Socket unable to bind: errno 112[0m
[0;32mI (14366) TestHeap: Free Heap size: 221992[0m
[0;32mI (15366) TestHeap: Free Heap size: 221992[0m
[0;32mI (16366) TestHeap: Free Heap size: 221992[0m
[0;32mI (17366) TestHeap: Free Heap size: 221992[0m
sources:
https://github.com/espressif/esp-idf/bl ... p_server.c

Can anyone help?

Re: tcp_server.c -> Socket unable to bind: errno 112

Posted: Fri May 10, 2019 8:35 am
by jackyc58

Re: tcp_server.c -> Socket unable to bind: errno 112

Posted: Sat Jul 27, 2019 8:53 am
by yuanyijie
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);
}
}