-
Notifications
You must be signed in to change notification settings - Fork 165
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
Fix autoreconnect #65
Conversation
I'm not sure how I feel about the changes in the Starscream file. I'd like to be able to keep tracking the Starscream library without any custom code if possible. Are those changes required? |
Oh ok. Well, the problem is that Starscream generate an NSError on disconnect even if the connection is closed with |
Yeah, I've just tried this myself and it does seem to be the case. I think we can check if the error's If that's the case then don't try and reconnect. How does that sound to you? |
Done. |
eventHandler.callback(eventData) | ||
} | ||
|
||
let jsonize = connection.options.attemptToReturnJSONObject ?? false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why add the ?? false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry it's because it's not based on #60
Thanks man :) |
After some debugging, I fixed the autoreconnect feature.
Now, the retry happens only if
1- the flag is set to
true
in the options2- the socket disconnection occurred because of an error
Hope you merge this asap in master. Thanks