Search found 2 matches

by liyafe1997
Tue Oct 29, 2024 8:05 am
Forum: ESP-IDF
Topic: close() does not really release the fd which is created by socket()
Replies: 2
Views: 574

Re: close() does not really release the fd which is created by socket()

Do not vTaskDelete() any other task than the current one (vTaskDelete(NULL);). If you have to, try only closing the socket from the other task, and have the socket-reading task check the value returned from recvfrom() for 0/-1 and then delete itself after releasing any ressources it may hold. Previ...
by liyafe1997
Mon Oct 28, 2024 2:09 pm
Forum: ESP-IDF
Topic: close() does not really release the fd which is created by socket()
Replies: 2
Views: 574

close() does not really release the fd which is created by socket()

I use socket(addrFamily, SOCK_DGRAM, ipProtocol); or socket(addrFamily, SOCK_STREAM, ipProtocol); to create UDP/TCP socket, then bind(), then recv()/recvfrom() in a FreeRTOS task, then vTaskDelete(the recv task) and close() it in another FreeRTOS task, whatever it is a TCP or UDP, seems the fd seems...