WAKING UP. After the phone wakes, every connection is checked with a
ping, and one that does not answer is replaced. The check used to send
ONE ping and wait thirty seconds by the wall clock: a ping lost in the
first instant after a wake, or a phone that dozed off again during the
wait, cost a healthy connection — hundreds of them in a night asleep. It
now asks again every second, counts only the time the app was really
running, accepts the answer to any of its pings, and no longer misses a
wake that arrives while a connection is busy with something else. In an
eight-hour night on two phones not one connection was replaced.
RESTARTS AND VK'S QUOTA. VK's relay lets one identity hold ten
allocations, and it keeps a released allocation on that quota for one
more second. A connection that restarted at once was therefore refused
(error 486), and the refusal put a perfectly good identity aside for
eleven minutes. The pool now keeps counting a seat for that second, so
the restart is seated elsewhere or waits a moment, and a refusal that
still arrives right behind our own release is no longer taken for a full
identity. Credentials that are refreshed in the background while
connections are using them keep an exact count of those connections. On
a network that refuses every connection — a captive portal before its
login — retries are now spaced out instead of bursting hundreds of times
a second.
WITH THE UDP RELAY LEG (an option, off by default). The release of an
allocation is confirmed by the relay before its connection restarts.
When a router or a public Wi-Fi forgets the UDP flows of a sleeping
phone, the phone wakes up behind a new address mapping: the relay no
longer recognises its packets, while the old allocations still hold
their places on the quota until they expire. Such a session is now ended
the moment the relay says so — it used to take the thirty-second check —
so the tunnel is back within seconds of the wake; the places held by
the old allocations stay counted until those can have expired, so the
new connections are not refused; and the log says what the mapping did
(ports only, never an address).
CSQTT. With the UDP relay leg a csqtt tunnel could go dead for good
after a sleep longer than an allocation lives (ten minutes), with 30/30
still on the screen. It now notices: when no worker has heard anything
for thirty seconds it probes them all, and if nothing answers — within
thirty seconds, or within five after a wake — every worker is restarted
under a new identity. "Conns" counts the workers heard from lately, and
the Internet box is cleared by a failed measurement (every transport). A
probe that goes unanswered is sent again instead of being judged on one
lost packet, which used to restart healthy workers after a short outage.
The delay before a restart no longer grows through a night of healthy
sessions, and a session that fails after the relay has accepted its
allocation counts that allocation against the quota like any other.
csqtt's counters reach the log once a minute and at the stop.
Client only — the server side is unchanged, so srtp-build306 remains
current.