ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
stream_response.h
Go to the documentation of this file.
1#pragma once
2
4
5// The long lived stream response the /events layer writes to, for the platform's web server
6#ifdef USE_ESP32
9
10#include <sys/socket.h>
11
13using web_server_idf::AsyncStreamResponse;
14// One entry of the gather list AsyncStreamResponse::write() takes
16// Guards the hand-off of new streams from the server task to the main loop
18} // namespace esphome::web_server_base
19#elif defined(USE_ARDUINO)
20// ESP8266, RP2040 and LibreTiny: ESPAsyncWebServer, with the connection taken from the request
23
25// Guards the hand-off of new streams from the network context to the main loop: the lwIP lock keeps RP2's network
26// IRQ out, the mutex LibreTiny's async_tcp task; each is a no-op where it is not needed (both on ESP8266)
28 public:
29 explicit StreamIntakeGuard(Mutex &mutex) : guard_(mutex) {}
30
31 protected:
34};
35} // namespace esphome::web_server_base
36#endif
Helper class that wraps a mutex with a RAII-style API.
Definition helpers.h:2494
Helper class to lock the lwIP TCPIP core when making lwIP API calls from non-TCPIP threads.
Definition helpers.h:2548
Mutex implementation, with API based on the unavailable std::mutex.
Definition helpers.h:2455
One entry of the gather list AsyncStreamResponse::write() takes; the TCP libraries take plain buffers...