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.

CC3100BOOST: CC3100 sl_Recv does not exit when client disconnects form AP

Part Number: CC3100BOOST

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.

  • Can you describe the setup a little more?

    The simplelink is set as Station or AP?

    When you say a user disconnects from the AP, you mean another client (not the simplelink device)?

    Shlomi

  • Simplelink is setup as AP. A mobile phone connects to the AP created by simplelink. If the user suddenly disconnects from the AP, the sl_Recv function keeps waiting to receive messages via TCP as if the user were still connected.
  • 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