Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years ago.
Program freezing when internet turns off?
I have quite a lot of code but the basic template is this:
//Includes and Defines //Functions int main() { wifi.connect(); ws.connect(); while(true) { //get temp //print temp ws.send(temp) ws.read(recv) } }
I'm using cc3000 and websocketclient and have got both working fine but when my internet crashes the program freezes in ws.read instead of timing out and carrying on. Further looking pinpoints the freeze to the TCPSocketConnection.cpp recieve function in the socket library. Any help would be much appreciated.
Where is the network port set to non-blocking and what timeout is it set to?
posted by Andy A 17 Dec 2014It's not in my program but in the WebsocketClient.cpp read function: