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

Question: having big trouble implementing auto-reconnect on websocket #32

Closed
akarelas opened this issue Oct 15, 2013 · 2 comments
Closed

Comments

@akarelas
Copy link

I don't know where to place the addHandler statements. Anywhere I try, problems errupt. deleteHandler doesn't seem to be doing anything. And I'll file a bug about this soon. So I have this question for the developers (the answer is not in the documentation, so please answer):

If I execute Connection.connect(...) 10 times while disconnected, and then the connection happens, how many times will the function(status) callback be executed every time the status changes from then on?

@akarelas
Copy link
Author

Another question: does Connection.disconnect remove the handlers? Sometimes the handlers are removed on disconnection, sometimes not. So I wonder.

@Gordin
Copy link
Contributor

Gordin commented Nov 29, 2013

  1. The Connection only has one callback that gets overwritten every time you call connect.
  2. If you are using WebSockets the callback should be called once, specifically the callback from the last connect, as connect will kill current WebSocket connections and overwrite callbacks. After the last connect() finished, those callbacks should be gone too though, because their socket does not exist any more.
    For BOSH I'm not sure, I guess the previous connections will also be terminated.

@Gordin Gordin closed this as completed Nov 29, 2013
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

2 participants