mirror of
https://github.com/esphome/esphome.git
synced 2025-09-03 03:42:20 +01:00
Fix unexpected disconnects when outgoing buffer is full during keepalive (#5988)
This commit is contained in:
@@ -140,6 +140,7 @@ class APIConnection : public APIServerConnection {
|
||||
void on_disconnect_response(const DisconnectResponse &value) override;
|
||||
void on_ping_response(const PingResponse &value) override {
|
||||
// we initiated ping
|
||||
this->ping_retries_ = 0;
|
||||
this->sent_ping_ = false;
|
||||
}
|
||||
void on_home_assistant_state_response(const HomeAssistantStateResponse &msg) override;
|
||||
@@ -217,6 +218,8 @@ class APIConnection : public APIServerConnection {
|
||||
bool state_subscription_{false};
|
||||
int log_subscription_{ESPHOME_LOG_LEVEL_NONE};
|
||||
uint32_t last_traffic_;
|
||||
uint32_t next_ping_retry_{0};
|
||||
uint8_t ping_retries_{0};
|
||||
bool sent_ping_{false};
|
||||
bool service_call_subscription_{false};
|
||||
bool next_close_ = false;
|
||||
|
Reference in New Issue
Block a user