Closed bertmelis closed 3 years ago
Is there any reason why
_tx_unacked_len
is not reset to zero on (re)connect?
For the record: I did try with resetting _tx_unacked_len
to zero in void AsyncClient::_connected
and I could not make my application to fail anymore. So this solves my issue. However, I'm not a TCP expert by far and I don't know the architecture of this library so I'm not 100% sure of any side-effects.
When other people also suffer from this issue: a workaround is to create the asyncclient dynamically and delete on disconnect.
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
not stale.
[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.
I've been stress testing my TCP queue and I ran into something that I don't quite understand.
The onAck callback is only called when
unacked
is zere: https://github.com/me-no-dev/ESPAsyncTCP/blob/15476867dcbab906c0f1d47a7f63cdde223abeab/src/ESPAsyncTCP.cpp#L552On sending, the
_tx_unacked_len
counter in incremented with the amount sent. On acking, the counter is decremented. And if zero, onAck is fired. Could it be that, should there be a disconnect between the two (also think of outside TCP like when I just pull my switches power cord),_tx_unacked_len
stays like it is. And when a new connection is setup, the counter increments and decrements but never reaches zero. And so the onAck never fires again.Is there any reason why
_tx_unacked_len
is not reset to zero on (re)connect?