Skip to content

Multiple clients connection be slow #522

Closed

Description

@faithandbrave

WebSocketTransport::connectToUrl() function is blocking, so connections from multiple WebSocket clients in parallel will be slow.
I think the library should implement async connect mode.

Activity

  1. bsergean commented on Nov 17, 2026

    @bsergean
    Collaborator

    Parallel client connection attempts are supported by the public WebSocket::start() API. Configure one WebSocket per connection, register its callback, and call start() on each instance. Each instance connects on its own background thread; starting the second client does not wait for the first handshake. connect() is the synchronous API.

    I verified the concurrent-start/shutdown path on current master with two clients per server over ten rounds under ThreadSanitizer (20 connections, 81 ms total). The threading documentation describes ownership and callback threads; #654 adds the parallel-start guidance explicitly.

    Closing this request as supported. A shared event loop with many connections per thread would be a separate scalability feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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