Emil Muratov 7bfbb947d0 queue deadlock and congestion aviodance
- do not let `_remove_events_with_arg()` call to block on queue pertubation, otherwise it could deadlock

 - in any case do not block on adding LWIP_TCP_POLL event to the queue, it does not make much sense anyway
   due to poll events are repetitive

 - `_get_async_event()` will discard LWIP_TCP_POLL events when q gets filled up
   this will work in combination with throttling poll events when adding to the queue
   Poor designed apps and multiple parallel connections could flood the queue with interleaved poll events
   that can't be properly throttled or coalesced. So we can discard it in the eviction task after coalescing
   It will work in this way:
    - queue is up to 1/4 full - all events are entering the queue and serviced
    - queue is from 1/4 and up to 3/4 full - new poll events are throttled on enqueue with linear probability
    - queue is from 3/4 up to full top - all new poll events are ignored on enqueue and existing poll events
      already in the queue are discarded on eviction with linear probability giving away priority for all other
      events to be serviced. It is expected that on a new poll timer connection polls could reenter the queue
2024-12-15 17:25:29 +09:00
2024-10-25 22:51:29 +02:00
2024-12-11 11:34:41 +01:00
2024-12-10 22:22:29 +01:00
2024-12-10 22:45:36 +01:00
2024-09-05 23:16:11 +02:00
2024-09-05 23:22:24 +02:00
2024-09-06 11:31:02 +02:00
2024-09-05 23:22:24 +02:00
2017-09-08 13:07:27 +03:00
2024-12-11 19:59:42 +01:00
2024-12-11 19:59:42 +01:00
2017-09-08 13:04:57 +03:00
2024-12-11 11:05:16 +01:00
2024-12-11 19:59:42 +01:00

AsyncTCP

License: LGPL 3.0 Continuous Integration PlatformIO Registry

A fork of the AsyncTCP library by @me-no-dev.

Async TCP Library for ESP32 Arduino

This is a fully asynchronous TCP library, aimed at enabling trouble-free, multi-connection network environment for Espressif's ESP32 MCUs.

This library is the base for ESPAsyncWebServer

AsyncClient and AsyncServer

The base classes on which everything else is built. They expose all possible scenarios, but are really raw and require more skills to use.

Changes in this fork

Coordinates

mathieucarbou/AsyncTCP @ ^3.2.15

Important recommendations

Most of the crashes are caused by improper configuration of the library for the project. Here are some recommendations to avoid them.

I personally use the following configuration in my projects:

  -D CONFIG_ASYNC_TCP_MAX_ACK_TIME=5000 // (keep default)
  -D CONFIG_ASYNC_TCP_PRIORITY=10 // (keep default)
  -D CONFIG_ASYNC_TCP_QUEUE_SIZE=64 // (keep default)
  -D CONFIG_ASYNC_TCP_RUNNING_CORE=1 // force async_tcp task to be on same core as the app (default is core 0)
  -D CONFIG_ASYNC_TCP_STACK_SIZE=4096 // reduce the stack size (default is 16K)
S
Description
Async TCP Library for ESP32
Readme 316 KiB
Languages
C++ 99.5%
CMake 0.4%
Makefile 0.1%