Fix socket connection closed not detected (#2587)

This commit is contained in:
Otto Winter authored and Otto winter committed 2021-10-22 18:26:21 +02:00
1 parent bbcd523967
commit f93e7d4e3a
5 files changed
+53 -15

No files matched your search

@@ -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);
}