Skip to content

RemoteLink WebSocket lacks disconnect event and automatic reconnect #344

@bingwe

Description

@bingwe

Description

Currently, the RemoteLink WebSocket in zenoh-ts does not provide any way to:

  1. Listen for a disconnect event (onclose) after the connection is established.
  2. Automatically reconnect when the WebSocket is disconnected.

This makes it difficult for users to detect lost connections and recover from network interruptions.

Expected Behavior

  • Emit a disconnect (or similar) event when the WebSocket connection is lost.
  • Optionally, support automatic reconnect with an exponential backoff strategy.

Steps to Reproduce

  1. Connect to a Zenoh router using RemoteLink.new(...).
  2. Stop the router after the connection is established.
  3. Observe that no events are emitted, and the connection does not automatically recover.

Additional Context

A ReconnectingWebSocket pattern could be implemented to handle disconnections and notify external listeners.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions