If a user disconnects from the AP, sl_Recv keeps waiting for messages. How can I force it to exit ? I tried closing the socket on SL_WLAN_DISCONNECT_EVENT case, but that did not work.
Thank you in advance for any advice.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
If a user disconnects from the AP, sl_Recv keeps waiting for messages. How can I force it to exit ? I tried closing the socket on SL_WLAN_DISCONNECT_EVENT case, but that did not work.
Thank you in advance for any advice.
I understand the setup now.
Since the client is disconnected on WiFi layer, the socket remains active for a much longer time (inactivity time) and there is no disconnect on the TCP level (the good side is that the TCP connection can still remain active in cases of WiFi reconnections).
In any case, the only way for sl_Recv() to know about it is to work in non-blocking mode (SL_SO_NONBLOCKING) and call sl_Recv() again if you get SL_EAGAIN.
Shlomi