hello,
I am new to ESP and I have issues understang AdvancedWebServer.ino
in line 141: server.handleClient(); is called repeatedly in loop(),
but there is no such function listed.
Instead, there are
line 41: void handleRoot()
line 80: void handleNotFound()
how does server.handleClient() know which one - and when - to call?
Is there perhaps a detailed tutorial available on this basic topic?
Re: example code AdvancedWebServer.ino (newbie basics)
[solved] example code AdvancedWebServer.ino (newbie basics)
Last edited by dsyleixa on Tue May 21, 2019 8:41 am, edited 1 time in total.
Re: example code AdvancedWebServer.ino (newbie basics)
hello,
I am new to ESP and I have issues understang AdvancedWebServer.ino
in line 141: server.handleClient(); is called repeatedly in loop(),
but there is no such function listed.
Instead, there are
line 41: void handleRoot()
line 80: void handleNotFound()
how does server.handleClient() know which one - and when - to call?
Is there perhaps a detailed tutorial available on this basic topic?
------------------------------------
edit: solved,
it's in the setup() function, surprisingly already before the begin Function
I am new to ESP and I have issues understang AdvancedWebServer.ino
in line 141: server.handleClient(); is called repeatedly in loop(),
but there is no such function listed.
Instead, there are
line 41: void handleRoot()
line 80: void handleNotFound()
how does server.handleClient() know which one - and when - to call?
Is there perhaps a detailed tutorial available on this basic topic?
------------------------------------
edit: solved,
it's in the setup() function, surprisingly already before the begin Function
Code: Select all
server.on("/", handleRoot);
server.on("/test.svg", drawGraph);
server.on("/inline", []() {
server.send(200, "text/plain", "this works as well");
});
server.onNotFound(handleNotFound);
Last edited by dsyleixa on Tue May 21, 2019 8:51 am, edited 1 time in total.
Who is online
Users browsing this forum: No registered users and 20 guests