esp32_https_server
esp32_https_server copied to clipboard
How to get the client connection status?
I would like to get the client connection status. What should I do it?
void handleRoot(HTTPRequest * req, HTTPResponse * res) {
String head = "--Hello\r\nContent-Type: image/jpeg\r\n\r\n";
String tail = "\r\n--Hello--\r\n";
res->setHeader("Access-Control-Allow-Origin", "*");
res->setHeader("Content-Type", "multipart/x-mixed-replace; boundary=Hello");
while ( **client.connected()** ) { //If the connection is closed, then stop responding.
//etc...
res->print("\r\n");
}
}