Keepalive: notice a connection that hangs without an error #81

Closed
opened 2026-10-17 21:23:09 +00:00 by littlefox · 1 comment
Owner

Follow-up to #52. Reconnecting starts when the connection's driver ends (an error or a close). A connection can also hang silently (a laptop waking on another network, a NAT dropping state): nothing arrives, and calls wait forever.

What:

  • A cheap call (get-time) every minute or so while idle; no answer within ~20 s means the connection is dead.
  • kom-client needs a way to close a connection from our side (Client::close or the driver ending on request), so the reconnect logic in #52 takes over.
  • Also on the web: the page coming back to the foreground (visibilitychange) checks at once.

Done when:

  • A test where the relay stops forwarding (but keeps the socket open) ends in a reconnect.
Follow-up to #52. Reconnecting starts when the connection's driver ends (an error or a close). A connection can also hang silently (a laptop waking on another network, a NAT dropping state): nothing arrives, and calls wait forever. What: - A cheap call (get-time) every minute or so while idle; no answer within ~20 s means the connection is dead. - kom-client needs a way to close a connection from our side (Client::close or the driver ending on request), so the reconnect logic in #52 takes over. - Also on the web: the page coming back to the foreground (visibilitychange) checks at once. Done when: - A test where the relay stops forwarding (but keeps the socket open) ends in a reconnect.
Author
Owner

Merged in #88. Client::close(); get-time every 45 s and when the page becomes visible; no answer in 20 s closes and reconnects. Unit test with a silent transport; reconnect.spec.ts makes the open socket pass nothing and checks the reconnect.

Merged in #88. Client::close(); get-time every 45 s and when the page becomes visible; no answer in 20 s closes and reconnects. Unit test with a silent transport; reconnect.spec.ts makes the open socket pass nothing and checks the reconnect.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
littlefox/neokom#81
No description provided.