If the connection attempt failed (if I run into a timeout) I would like to leave the loop and start everything from the beginning.
Does "break" implicitly close all client connections ?
I have code that is as failsafe as it can be, but it is designed for the w5100. I don't know if the ESP8266 has the same weaknesses. You might need to test it to see. The w5100 can fail if clients connect without sending anything, then not send a disconnect message. It uses all the sockets. Post scanning apps sometimes do this.
My server code on the playground has a checkSockStatus function that checks and releases the sockets if they are frozen by a rogue app. Maybe some of the features I have incorporated into my code can be adapted for use with the ESP8266. http://playground.arduino.cc/Code/WebServerST
Gawan:
If the connection attempt failed (if I run into a timeout) I would like to leave the loop and start everything from the beginning.
The reason I said "That depends on what you want to achieve" in Reply #4 is that it does not seem to make any sense to start over if the connection failed - won't it just fail again?
And if you just want to keep trying why not make the timeout period longer?
My HTTP-Response is refreshing the page on a regular bases
--> meta http-equiv='refresh' content='60'
For any reason it works for minutes, but suddenly it fails ... it simply gets stuck here:
while(!client.available()){
delay(1);
I do not see a reason so far.
As soon as I reset the whole thing it works perfectly fine again ... for minutes.
I'd like to do the manual resetting in my code and I expect this to work if I simply re-run the loop from the beginning
ok, I think you are not using any arduino hardware, but only esp8266 module that uses arduino ide.
you will get better help if you contact the author of that library directly.