Sends ping even if there is active traffic

Issue #23 closed
Markus KARG created an issue

The description of PingManager says that the pings are not sent in case other stanzas as sent.

This is wrong.

(a) Set PingManager to 15 seconds. Wait for 15 seconds. A ping is correctly sent. Then start to send one chat state message per second, and you will notice that after 15 seconds there actually is a ping sent! According to the description, that must not happen.

(b) It actually is a bad idea to not sent any pings in case there are other stanzas sent, as that stanzas do not imply any answers from the server -- so the client cannot detect whether the connection is broken or the server is down. The ping manager must always send pings, independent of any other traffic, so the client will see the fail.

Comments (4)

  1. Christian Schudt repo owner

    Thanks for pointing that out. It only occurred after the first ping has been sent, any further pings weren't canceled correctly.

    @ b) I agree, but IMO it is still correct, if pings are rescheduled on inbound traffic, because it means the connection is still alive, hence no ping is necessary.

  2. Log in to comment