UDP sendto return ENOMEM when a station disconnected.
UDP sendto return ENOMEM when a station disconnected.
There are three devices A, B and C, where A is the AP, B and C are the stations. Device A sends data to the B and C using UDP, during the transmiting, if B or C disconnected or powered off, the sendto() will return ENOMEM for a long time (approximate 3 seconds). I traced this issue and find esp_wifi_internal_tx() return this error. Does anyone know the reason for this issue?
Re: UDP sendto return ENOMEM when a station disconnected.
please see the codes below:
int ret_len = sendto(socket_fd, tx_buffer, sizeof(tx_buffer), 0, (struct sockaddr*)&server_addr, server_addr_len);
if (ret_len < 0)
{
ESP_LOGI(TAG, "sent to %s failed, errno=%d:%s", inet_ntoa(server_addr.sin_addr), errno, strerror(errno));
}
vTaskDelay(pdMS_TO_TICKS(5));
int ret_len = sendto(socket_fd, tx_buffer, sizeof(tx_buffer), 0, (struct sockaddr*)&server_addr, server_addr_len);
if (ret_len < 0)
{
ESP_LOGI(TAG, "sent to %s failed, errno=%d:%s", inet_ntoa(server_addr.sin_addr), errno, strerror(errno));
}
vTaskDelay(pdMS_TO_TICKS(5));
Who is online
Users browsing this forum: Baidu [Spider] and 138 guests