[riot-commits] [RIOT-OS/RIOT] 18910c: asymcute: Reset keepalive counter on connection ACK

benpicco noreply at github.com
Thu Sep 12 15:55:12 CEST 2019


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: 18910cf4e2c6ca59830165e9b0916e5a19722694
      https://github.com/RIOT-OS/RIOT/commit/18910cf4e2c6ca59830165e9b0916e5a19722694
  Author: Derek Hageman <hageman at inthat.cloud>
  Date:   2019-08-20 (Tue, 20 Aug 2019)

  Changed paths:
    M sys/net/application_layer/asymcute/asymcute.c

  Log Message:
  -----------
  asymcute: Reset keepalive counter on connection ACK

When a keepalive timeout occurs keepalive_retry_cnt remains zero,
so when the connection is re-established _on_keepalive_evt will
immediately disconnect instead of actually sending a keepalive ping.

The sequence looks like:
  1. _on_connack: start con->keepalive_timer
  2. Server does not respond to keepalive pings
  3. _on_keepalive_evt: con->keepalive_retry_cnt reaches zero
  4. Connection torn down and ASYMCUTE_DISCONNECTED sent to application
  5. Application starts reconnection
  6. _on_connack: start con->keepalive_timer again
  7. First _on_keepalive_evt: con->keepalive_retry_cnt is still zero
  8. Repeat from 4.

So this simply resets keepalive_retry_cnt in _on_connack when
the keepalive timer is restarted.  It's a new connection, so
resetting the keepalive retry counter make senses regardless.

Signed-off-by: Derek Hageman <hageman at inthat.cloud>


  Commit: bf2aaa1a5d6b0bc5c618fee4304d2a81c02be492
      https://github.com/RIOT-OS/RIOT/commit/bf2aaa1a5d6b0bc5c618fee4304d2a81c02be492
  Author: benpicco <benpicco at googlemail.com>
  Date:   2019-09-12 (Thu, 12 Sep 2019)

  Changed paths:
    M sys/net/application_layer/asymcute/asymcute.c

  Log Message:
  -----------
  Merge pull request #12049 from Sizurka/fix-asymcute-reconnect

asymcute: Reset keepalive counter on connection ACK


Compare: https://github.com/RIOT-OS/RIOT/compare/af45ebececfc...bf2aaa1a5d6b


More information about the commits mailing list