Closed nonoo closed 2 years ago
Thanks for your contribution.
Hi @nonoo
Thanks for implementing this useful feature. I would however suggest posting it to the lwip upstream: https://savannah.nongnu.org/patch/?group=lwip
We generally try to accept only the bugfixes and updates necessary for essential esp-lwip
operation with IDF. More so lately, as you can guess from other active issues and PRs, we're trying hard to converge to the upstream rather than diverge from it.
Please note, that IDF has a solution for this usecase already, using VFS component and event-fds, if we wanted to notify and unblock a select()
with custom events:
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/storage/vfs.html#event-fds
Thanks for the info! I didn't know about event-fds. I'll convert my app to use those.
This feature works similarly to RTCS's SO_EXCEPTION. Setting an SO_EXCEPTION value for a socket using setsockopt() breaks out from blocking select() calls and puts the socket into the returned exception fd_set. The exception value can be read using getsockopt(). Reading SO_EXCEPTION with getsockopt() clears the exception.
Example usage: