static void lwip_socket_drop_registered_memberships(int s);
#endif /* LWIP_IGMP */
-#if ESP_LWIP
-#include "esp_wifi_internal.h"
-#include "esp_system.h"
-
-/* Please be notified that this flow control is just a workaround for fixing wifi Q full issue.
- * Under UDP/TCP pressure test, we found that the sockets may cause wifi tx queue full if the socket
- * sending speed is faster than the wifi sending speed, it will finally cause the packet to be dropped
- * in wifi layer, it's not acceptable in some application. That's why we introdue the tx flow control here.
- * However, current solution is just a workaround, we need to consider the return value of wifi tx interface,
- * and feedback the return value to lwip and let lwip do the flow control itself.
- */
-static inline void esp32_tx_flow_ctrl(void)
-{
-//TODO we need to do flow control for UDP
-#if 0
- uint8_t _wait_delay = 1;
-
- while ((system_get_free_heap_size() < HEAP_HIGHWAT) || esp_wifi_internal_tx_is_stop()){
- vTaskDelay(_wait_delay/portTICK_RATE_MS);
- if (_wait_delay < 64) _wait_delay *= 2;
- }
-#endif
-}
-
-#else
-#define esp32_tx_flow_ctrl()
-#endif
-
/** The global array of available sockets */
static struct lwip_sock sockets[NUM_SOCKETS];
#if ESP_THREAD_SAFE
#endif /* LWIP_TCP */
}
- esp32_tx_flow_ctrl();
-
if ((to != NULL) && !SOCK_ADDR_TYPE_MATCH(to, sock)) {
/* sockaddr does not match socket type (IPv4/IPv6) */
sock_set_errno(sock, err_to_errno(ERR_VAL));
#define ESP_IP4_ATON 1
#define ESP_LIGHT_SLEEP 1
-
#define TCP_WND_DEFAULT (4*TCP_MSS)
#define TCP_SND_BUF_DEFAULT (2*TCP_MSS)
#define CHECKSUM_CHECK_UDP 0
#define CHECKSUM_CHECK_IP 0
-#define HEAP_HIGHWAT 20*1024
-
#define LWIP_NETCONN_FULLDUPLEX 1
#define LWIP_NETCONN_SEM_PER_THREAD 1