Commit Graph
132 Commits
Author SHA1 Message Date
Mathieu Carbou 5d00a45410 upgrade 2024-05-15 07:41:50 +02:00
Mathieu Carbou 1594d56060 v3.1.2 2024-04-27 14:18:08 +02:00
Mathieu Carbou 212780ced1 Reduce logging of non critical messages 2024-04-27 14:17:23 +02:00
Mathieu Carbou 1b443f97ab v3.1.1 2024-04-27 12:31:07 +02:00
Mathieu Carbou 65b4e998c7 Grab fixes from https://github.com/me-no-dev/AsyncTCP/pull/173 2024-04-27 12:31:07 +02:00
Mathieu Carbou 85988d5a44 CONFIG_ASYNC_TCP_MAX_ACK_TIME 2024-04-27 12:20:28 +02:00
Mathieu Carbou 9b5f04627f v3.1.0 2024-04-27 01:19:50 +02:00
Mathieu Carbou ec5d01ed59 code cleanup 2024-04-27 01:17:55 +02:00
Mathieu Carbou db8cfa1ee7 Add setKeepAlive() 2024-04-27 01:17:55 +02:00
Mathieu Carbou 46a1dce19f Set CONFIG_ASYNC_TCP_QUEUE_SIZE to 64 2024-04-27 01:17:55 +02:00
Mathieu Carbou 92628f1f4d Set CONFIG_ASYNC_TCP_PRIORITY to 10 2024-04-27 01:17:55 +02:00
Mathieu Carbou de284cc5cc Add CONFIG_ASYNC_TCP_QUEUE_SIZE 2024-04-27 01:17:55 +02:00
Mathieu Carbou 0227108fc4 Add CONFIG_ASYNC_TCP_PRIORITY 2024-04-27 01:17:55 +02:00
Mathieu Carbou 29b1807a5a IDE file 2024-04-27 01:17:55 +02:00
Mathieu Carbou af2991a133 Remove Jason2866 from CI 2024-04-20 23:01:09 +02:00
Mathieu Carbou e49705cdb9 cleanup 2024-04-20 16:27:46 +02:00
Mathieu Carbou 1f1d7a4d7c Try CI with S3 board 2024-04-20 16:18:02 +02:00
Mathieu Carbou aac8c67dae v3.0.2 2024-04-20 12:31:17 +02:00
Mathieu Carbou 482cddd835 Remove warning 2024-04-20 12:20:45 +02:00
Mathieu Carbou 755c8cb8e0 v3.0.1 2024-04-20 11:48:50 +02:00
Mathieu Carbou 3a2435e617 Update project files and CI 2024-04-20 11:44:21 +02:00
Mathieu Carbou ea3ebd7289 Do not rely on configENABLE_BACKWARD_COMPATIBILITY 2024-04-20 11:14:17 +02:00
Mathieu Carbou 81f30aaa72 Add some project files 2024-04-20 11:06:36 +02:00
Mathieu Carbou f9a1c81464 doc update 2024-04-19 23:54:56 +02:00
Mathieu Carbou 1a183074fe Update lib name 2024-04-19 23:47:14 +02:00
Mathieu Carbou 1824a6d52e Fix name field 2024-04-19 23:40:44 +02:00
Mathieu Carbou 70943fffbf v3.0.0 2024-04-19 23:33:28 +02:00
Mathieu Carbou e0ea42c081 Merge pull request #6 from mathieucarbou/arduino-3
Arduino 3 / ESP IDF 5 compatibility
2024-04-19 23:23:12 +02:00
Mathieu Carbou c4cb7653fe Arduino 3 / ESP IDF 5 compatibility 2024-04-19 22:43:05 +02:00
Mathieu Carbou ab88e23434 fix CI to support building both with Arduino release version and future version (currently v3 rc1) 2024-04-19 19:21:40 +02:00
Mathieu Carbou 1518f62a24 Add back library.properties required for Arduino projects 2024-04-19 19:21:27 +02:00
Jesse Hills 54fcd1085d Bump version to 2.1.3 2024-02-22 09:27:52 +13:00
Jimmy Hedman 2ae3787c71 Fixes libretiny (#10) 2024-02-19 08:08:25 +13:00
Jesse Hills d852ef9c21 Bump version to 2.1.2 2024-02-08 08:28:20 +13:00
Jimmy Hedman 87d4daa4ab Make LIBRETINY compile (#9) 2024-01-22 18:31:54 +09:00
Jesse Hills 117fee9149 Bump version to 2.1.1 2024-01-18 08:16:33 +09:00
Jimmy Hedman bf3e4d23f3 Rework CI and fix an error (#6) 2024-01-18 08:13:53 +09:00
Jesse Hills ab9b7d4a22 Bump version to 2.1.0 2023-12-21 13:01:47 +09:00
Jimmy HedmanandPaweł pidpawel Kozubal 42a8644bb2 IPv6 support added (#5)
Co-authored-by: Paweł pidpawel Kozubal <pawel.kozubal@husarnet.com>
2023-12-21 12:59:30 +09:00
Jesse Hills dc64fedec0 Bump version to 2.0.1 2023-09-01 14:18:18 +12:00
Kuba Szczodrzyński c53368456f Rename LibreTuya to LibreTiny (#4) 2023-09-01 14:12:55 +12:00
Jesse Hills c043464129 Bump version to 2.0.0 2022-08-09 17:34:36 +12:00
Kuba Szczodrzyński fb0411b699 Adapt for LibreTuya compatibility (#3) 2022-08-09 17:34:14 +12:00
Guillermo Ruffino 7c767c3f6b Bump version to 1.2.2 2021-05-09 19:11:18 -03:00
Guillermo Ruffino bfcba1f344 Merge pull request #1 from mmakaay/master
Better fix for "ack timeout 4" client disconnects.
2021-05-09 19:10:19 -03:00
Maurice Makaay 18ac673e82 Define one_day var as a const. 2021-05-06 00:41:06 +02:00
Maurice Makaay 6f379678f0 Better fix for "ack timeout 4" client disconnects.
After my first attempt at fixing the client disconnects
(https://github.com/OttoWinter/AsyncTCP/pull/4) got merged
into AsyncTCP, it turned out that there was regression
for some devices: the connection stability actually went
down instead of up.

After a lot of debugging and discussion with @glmnet (some of
the results can be found in the above pull request discussion),
we came up with an improved fix for the disconnect issues.

**Changed:**

The code that checks for ACK timeouts has been simplified in
such way, that only two timestamps are now used to determine if
an ACK timeout has happened: the time of the last sent packet
(this was already recorded), and the time of the last received
ACK from the client (this has been added).

Using these timestamps, there is no more need for a separate field
to keep track if we are waiting for an ACK or not (`_pcb_busy`).
Therefore, this field was completely removed from the code.

While I was at it, I renamed a few variables to make the code
easier to read and more consistent.

**Results:**

I connected Home Assistant plus 8 OTA loggers at the same time,
using very verbose logging output. This normally was an easy way
to trigger the disconnect errors.

It turned out, this solution runs as solid for me, as when disabling
the ACK timeout checks completely
(using `AsyncClient::setAckTimeout(0)`).
2021-05-05 23:56:48 +02:00
Otto Winter f278522a59 Bump version to 1.2.1 2021-04-11 19:09:48 +02:00
Maurice MakaayandMaurice Makaay 030b747616 Fix race condition causing 'ack timeout 4' disconnects (#4)
The AsyncClient::send() methods sets a boolean to true after pushing
data over the TCP socket successfully using tcp_output(). It also sets
a timestamp to remember at what time the data was sent.

The AsyncClient::_sent() callback method reacts to ACKs coming from
the connected client. This method sets the boolean to false.

In the AsyncClient::_poll() method, a check is done to see if the
boolean is true ("I'm waiting for an ACK") and if the time at which
the data was sent is too long ago (5000 ms). If this is the case,
a connection issue with the connected client is assumed and the
connection is forcibly closed by the server.

The race condition is when these operations get mixed up, because
of multithreading behavior. The _sent() method can be called during
the execution of the send() method:

1. send() sends out data using tcp_output()
2. _sent() is called because an ACK is processed, sets boolean to false
3. send() continues and sets boolean to true + timestamp to "now"

After this, the data exchange with the client was successful. Data were
sent and the ACK was seen.
However, the boolean ended up as true, making the _poll() method think
that an ACK is still to be expected. As a result, 5000 ms later, the
connection is dropped.

This commit fixes the code by first registering that an ACK is
expected, before calling tcp_output(). This way, there is no race
condition when the ACK is processed right after that call.

Additionally, I changed the boolean to an integer counter value.
The server might send multiple messages to the client, resulting in
multiple expected ACKs. A boolean does not cover this situation.

Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-04-11 19:09:21 +02:00
Otto winter cfecaa3a1c Bump version to 1.2.0 2021-04-08 15:34:35 +02:00