1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-04 12:22:20 +01:00

Fix socket connection closed not detected (#2587)

This commit is contained in:
Otto Winter
2021-10-22 10:46:44 +02:00
committed by GitHub
parent 68c8547067
commit 9220d9fc52
5 changed files with 53 additions and 15 deletions

View File

@@ -78,6 +78,8 @@ void APIConnection::loop() {
on_fatal_error();
if (err == APIError::SOCKET_READ_FAILED && errno == ECONNRESET) {
ESP_LOGW(TAG, "%s: Connection reset", client_info_.c_str());
} else if (err == APIError::CONNECTION_CLOSED) {
ESP_LOGW(TAG, "%s: Connection closed", client_info_.c_str());
} else {
ESP_LOGW(TAG, "%s: Reading failed: %s errno=%d", client_info_.c_str(), api_error_to_str(err), errno);
}