WebServer and EthernetClient.stop()
i have customized version of webserver works well, when click link or button in browser go page, see "waiting connect..." message on browser status line. "core" of webserver update method, lifted standard webserver library, , called on each pass through loop(), below.
keep in mind, know squat web servers. little know has been learned in process of cobbling webserver 1 application. however, note client.stop() @ end, , wonder if correct behavior web server in middle of interactive session? there reason close connection, , not leave open process further requests? have why server unresponsive as 10-20 seconds @ time? browser re-connect, eventually, may take several refresh attempts before does. other times, can go page-to-page reckless abandon, , fine. haven't yet attempted debug this, curious whether 1 aspect of code right.
regards,
ray l.
code: [select]
void webserver::update(void)
{
ethernetclient client = pmyethernetserver->available();
if (client)
{
// client connected arduino need extract the
// following fields http request.
buffer requestcontent; // request content null-terminated string.
methodtype emethod = readhttprequest(client, requestcontent);
// parse request , send content here
// give web browser time receive data
delay(1);
client.stop();
}
}
keep in mind, know squat web servers. little know has been learned in process of cobbling webserver 1 application. however, note client.stop() @ end, , wonder if correct behavior web server in middle of interactive session? there reason close connection, , not leave open process further requests? have why server unresponsive as 10-20 seconds @ time? browser re-connect, eventually, may take several refresh attempts before does. other times, can go page-to-page reckless abandon, , fine. haven't yet attempted debug this, curious whether 1 aspect of code right.
regards,
ray l.
which ethernet shield , library using?
what code? it?
you should post code, not snippet.
what code? it?
code: [select]
methodtype emethod = readhttprequest(client, requestcontent);
you should post code, not snippet.
Arduino Forum > Using Arduino > Programming Questions > WebServer and EthernetClient.stop()
arduino
Comments
Post a Comment