Skip to content

Slow to response when make intensive connection request #120

@iwknow

Description

@iwknow

In my app, I need to scan through 10 webSocket addresses to see which one is available regularly. Here is how I use the client:

var wsConn = $websocket('ws://mySite.com', null, {maxTimeout: WS_CONNECT_TIMEOUT});

wsConn.onError(function(event) {
                        // try another address});
                    wsConn.onOpen(function() {
                        // do something for success                    });
                    wsConn.onMessage(function(msg) {
                        // do something for receiving message
                    });

The first couple rounds of scan works alright. Either onError or onOpen will be triggered in 20ms. But after that, it become really slow. onError or onOpen are usually triggered after 2000ms. Even refresh the page doesn't help. If i open a new tab or restart browser, it works fine and becomes slow after couple rounds of scan.

I use Chrome.

Any idea? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions