Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multiple web sockets at once #57

Merged
merged 2 commits into from
Apr 16, 2017
Merged

Commits on Feb 1, 2017

  1. Handle multiple websocket connections

    Sometimes I (accidentally or deliberately) have more than one browser
    window or tab open to my app, and in that case I would like all of
    them to refresh when I change the code.
    
    The old behaviour is that just one client, the last to connect to the
    websocket server, would refresh when the `reloadServer.reload()` method
    is called.
    
    Note that this only changes the behaviour when the `reloadServer.reload()`
    function is used: it would always behave correctly if the clients are signalled
    by stopping the server.
    
    This PR changes (an undocumented property of) the public API, in that the
    `.connection` object is replaced by a `.connections` object. HOWEVER, this
    change will not break any existing code, for the simple reason that previously
    the `.connection` object was always undefined! The code was returning it before
    it had been assigned: it was assigned in the handler for the wss "connection" event.
    theduncanclark authored and robinhouston committed Feb 1, 2017
    Configuration menu
    Copy the full SHA
    9b7fd0e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2c0238a View commit details
    Browse the repository at this point in the history