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

adam_esp
Posts: 37
Joined: Mon Apr 29, 2019 12:09 pm

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

Postby adam_esp » Mon Apr 29, 2019 2:14 pm

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?

jackyc58
Posts: 2
Joined: Wed Apr 24, 2019 8:41 am

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

Postby jackyc58 » Fri May 10, 2019 8:35 am


yuanyijie
Posts: 2
Joined: Sat Jul 27, 2019 8:49 am

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

Postby yuanyijie » Sat Jul 27, 2019 8:53 am

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);
}
}

Who is online

Users browsing this forum: abbas1375, Baidu [Spider] and 72 guests