Merge branch 'fix/example_socket_len' into 'master'

fix(examples): Fix socket example incorrect len/error handling

Closes IDFGH-17113

See merge request espressif/esp-idf!47199
This commit is contained in:
David Čermák
2026-04-15 17:13:36 +08:00
@@ -96,7 +96,10 @@ static int socket_send(const char *tag, const int sock, const char * data, const
int to_write = len;
while (to_write > 0) {
int written = send(sock, data + (len - to_write), to_write, 0);
if (written < 0 && errno != EINPROGRESS && errno != EAGAIN && errno != EWOULDBLOCK) {
if (written < 0) {
if (errno == EINPROGRESS || errno == EAGAIN || errno == EWOULDBLOCK) {
continue;
}
log_socket_error(tag, sock, errno, "Error occurred during sending");
return -1;
}