If there is an unclean disconnection of the TCP socket, ENOTCONN (128) may be returned.
The log will then be flooded with warnings/errors about not being able to read/write and a socket will be blocked from the pool.
For reference, see https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/lwip.html#socket-error-reason-code - there may be other codes that need handling in the same way (e.g. ENETRESET).
It may alternatively just make sense to simply close the socket in case of "other error"
If there is an unclean disconnection of the TCP socket, ENOTCONN (128) may be returned.
The log will then be flooded with warnings/errors about not being able to read/write and a socket will be blocked from the pool.
For reference, see https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/lwip.html#socket-error-reason-code - there may be other codes that need handling in the same way (e.g. ENETRESET).
It may alternatively just make sense to simply close the socket in case of "other error"