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

Slow to response when make intensive connection request #120

Open
iwknow opened this issue Jun 29, 2017 · 0 comments
Open

Slow to response when make intensive connection request #120

iwknow opened this issue Jun 29, 2017 · 0 comments

Comments

@iwknow
Copy link

iwknow commented Jun 29, 2017

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!

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

No branches or pull requests

1 participant