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

Reconnect after connection lost #60

Closed
27leaves opened this issue Jan 3, 2017 · 5 comments
Closed

Reconnect after connection lost #60

27leaves opened this issue Jan 3, 2017 · 5 comments

Comments

@27leaves
Copy link

27leaves commented Jan 3, 2017

To automatically reconnect after the connection is lost in autobahnjs, you have to return false in the onclose method, like:

connection.onclose = function () {
   return false;
}

Unfortunately, I think there is no way to do this right now in angular-wamp, but I need it in my application. Is there another way, or could we implement it into the library?

@27leaves
Copy link
Author

Hello guys,
I'd really need this feature, otherwise no automatic reconnect is possible. I could also write a PR, if you guide me :)

@davidwdan
Copy link
Member

@creat-or looking through autobhanjs's docs and I can't find where it says that returning false will automatically reconnect.

@27leaves
Copy link
Author

@davidwdan Yeah, it's hard to find. http://autobahn.ws/js/reference.html#connection-callbacks

"lost": The connection had been formerly established at least once, but now was lost. Automatic reconnection will happen unless you return falsy from this callback.

Funny enough it's unfortunately implemented in the exact opposite way. I tested it on another project (with autobahn.js without angular-wamp). Also at that time I found this solution in a comment, but I cannot find it right now.

@27leaves
Copy link
Author

@davidwdan hello again, did you already have time to look into this?

@27leaves
Copy link
Author

Hey @davidwdan I'm sorry... reconnect works as expected, I had an issue with my configuration. 🙈

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