I am creating a server application where I am able to use the CC3000 to respond to requests from a client. I am able to connect to the CC3000 with the client and send and receive data no problem using the select() function and checking the writesds and readsds. However, when the client disconnects, the CC3000 has no idea and therefore never closes the socket.
I have tried using select() and checking the "exceptsds", but none of the bits are ever set.
I have tried sending select() and checking writesds, but it responds saying the socket is ready to receive data even after it has disconnected.
I have tried sending data of length "0", and of other various lengths, but the send() command always responds with a success, and and eventually the CC3000 buffers fill up (since the messages aren't going anywhere) and the program gets stuck.
I have tried sending the getsockopt() command also, but this command always returns a success.
What is the correct way to sense when a client has disconnected using the CC3000 module?