Merge pull request #12333 from tymoteuszblochmobica/udpfix

UDP echotests  fix  in case of no memory or device busy.
pull/12357/head
Martin Kojtal 2020-02-03 12:35:58 +00:00 committed by GitHub
commit f7c58221be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View File

@ -100,7 +100,6 @@ void UDPSOCKET_ECHOTEST_impl(bool use_sendto)
packets_sent++; packets_sent++;
} else { } else {
tr_warn("[Round#%02d - Sender] error, returned %d", s_idx, sent); tr_warn("[Round#%02d - Sender] error, returned %d", s_idx, sent);
continue;
} }
do { do {
@ -207,7 +206,6 @@ void UDPSOCKET_ECHOTEST_NONBLOCK_impl(bool use_sendto)
--retry_cnt; --retry_cnt;
} else { } else {
tr_warn("[Round#%02d - Sender] error, returned %d", s_idx, sent); tr_warn("[Round#%02d - Sender] error, returned %d", s_idx, sent);
continue;
} }
int recvd; int recvd;

View File

@ -41,7 +41,7 @@ void UDPSOCKET_SENDTO_REPEAT()
bool oom_earlier = false; // 2 times in a row -> time to give up bool oom_earlier = false; // 2 times in a row -> time to give up
for (i = 0; i < 100; i++) { for (i = 0; i < 100; i++) {
sent = sock.sendto(udp_addr, tx_buffer, sizeof(tx_buffer)); sent = sock.sendto(udp_addr, tx_buffer, sizeof(tx_buffer));
if (sent == NSAPI_ERROR_NO_MEMORY) { if (sent == NSAPI_ERROR_NO_MEMORY || sent == NSAPI_ERROR_BUSY) {
if (oom_earlier) { if (oom_earlier) {
break; break;
} }