In your Building Web Servers course you kind of gloss over the SSE interface. Specifically, the need to pass the time via millis() and the sending of “ping”. When you update the course can you elaborate a little more on this?
https://pastebin.com/Zum6Qsdp
Hi.
Yes. I can elaborate a bit about that.
That line is used on the SSE examples of the ESPASyncWebServer library. That line is not mandatory.
It is used to check on the client side that the server is alive.
Basically, we’re sending a message “ping” to the server, every x number of seconds.
The message is “ping”, it doesn’t have a specific event assigned to it, and we should also pass the time (millis()).
events.send("ping",NULL,millis());
I can elaborate more on the eBook on the next eBook update.
Thanks for your feedback.
Regards,
Sara