Skip to content

Track sync server connectivity#56

Open
ikusteu wants to merge 2 commits intovlcn-io:mainfrom
codemyriad:track-sync-server-connectivity
Open

Track sync server connectivity#56
ikusteu wants to merge 2 commits intovlcn-io:mainfrom
codemyriad:track-sync-server-connectivity

Conversation

@ikusteu
Copy link

@ikusteu ikusteu commented Jan 13, 2026

Add the ability to track sync server connectivity:

  • add onConnOpen and onConnClose to Transport interface
  • extend WebSocketTransport to implement these methods

Current implementation:

  • the client polls (pings the server) setting the timeout after which the connection is considered closed:
    • onConnClose is called
    • the socket is closed and connection retried at an interval
    • note: the transport is not considered closed at this point, it's merely retrying the connection (full close will stop it retrying)
  • in case a sign of life from the server is received within the aforementioned timeout, the timeout is reset
  • all server received messages are treated as a sign of life: both the explicit pong message, as well as any other server sent event

The timeout (how long we wait for sign of life) and interval (poll frequency) are configurable via pingTimeout and pingInterval transport options (respectively)

* update Transport interface to specify onConnOpen and onConnClose callbacks
* implement the aforementioned handlers for WebSocketTransport
* extend TransportOptions with 'pingInterval' and 'closeTimeout' (controlling server polling for connection status)
* extend WebSocketTransport to poll server for sign of life
* extend ws-server (ConnectionBroker) to respond to ping messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant