At the end of an HTTP client connection if I call client.close too quickly browsers don't get the whole page; the footer and maybe some trailing HTML cuts off. So I call delay(250) and it works, trouble is I'm wasting time in that delay stall.
Any way to make that non-blocking like we do in LED activity?
client = server.available();
if (client) {
...
if url==foo { this/that type stuff...
}
...
delay(250);
client.stop();
}
Delta_G:
call client.flush() right before client end. That still blocks but only long enough for the outgoing transmission to end.
In lieu of client.stop? Or are call .stop after .flush?
EDIT: If I don't call client.stop the browser spins away terminally. So I put .flush above .stop and removed the delay but the pages still don't reliably complete. Could it have to do with footer includes that pull in from public servers? I'm going to try serve them locally to speed things up. Might be on the wrong path though.
If you are using Connection: close, perhaps waiting for client.connected() to return false will do the job. Which HTTP library are you using? Where is the documentation for it? That's the first place to look, you know.
PaulMurrayCbr:
If you are using Connection: close, perhaps waiting for client.connected() to return false will do the job. Which HTTP library are you using? Where is the documentation for it? That's the first place to look, you know.
So instead of calling Connection: close in each if/else, you're suggesting removal and placing just one after I close out client.connected() ?
lastchancename:
Maybe your web page content isn't complete...?
The browser will usually close the session once the appropriate HTML tags have been balanced.
Innocent omissions cause all sorts of issues - i've done it a few times
It is complete, because pressing F5 once or twice will yield a full load (and not CTL-F5, but that works, too). Seems like a timing issue in the code. I didn't intend for this to veer into HTML structure but thought since you questioned it I'd post the page source for a good and failed page load. The whole page is too large to post here.