The TI E2E™ design support forums will undergo maintenance from Sept. 28 to Oct. 2. If you need design support during this time, contact your TI representative or open a new support request with our customer support center.

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.

socket closed by client, detect event, non-blocking sl_Recv()

Other Parts Discussed in Thread: CC3200

Hi, I want to figure out how to get the CC3200 to quickly detect a dropped client (client closes socket) with the CC3200 running as a socket server operating with periodic calls to a non-blocking socket read sl_Recv().

I'm running my CC3200 in P2P mode as a socket server after the P2P network is established (CC3200 is P2P client), after the SL_NETAPP_IPV4_ACQUIRED event. It's a non-OS app with periodic calls to a non-blocking socket read, sl_Recv(). This works great for my purpose, but I can't seem to detect when the socket client drops the socket connection unless I actually try to write out the socket with the CC3200, in which case, I'll get a SL_SOC_ERROR returned from the sl_Send() call. I was hoping to avoid writing data out just to detect the dropped connection.

I am monitoring all the NETAPP events, WLAN events, looking for SOCK events using the

SimpleLinkSockEventHandler(SlSockEvent_t *pSock)

but I'm not getting any events fired here when the group owner (the device on the other side of the CC3200 P2P socket connection) closes the socket, and the manual section 19.3 doesn't reference SL_SOCKET_CLOSED events.

I don't know if the fact that I'm using P2P matters at all, but I thought I'd mention it just in case. I can readily intercept the WLAN DISCONNECT events when the GO drops the P2P connection, but that's not the same thing.

I wonder if the BSD socket poll() would be useful here if it were implemented?

I tried enabling SL_SO_KEEPALIVE on the CC3200 side, ( how to reduce 300 second keep alive interval? ) waited 5+ minutes, but still no events were fired off on the CC3200 side after the client had closed the socket.

What's the best solution here for this platform? Do I have to implement some periodic write at the application level?

Alex