-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Re-connecting a disconnected socket #11
Comments
Hi Luke, You observations are correct. I'm modeling it after the semantics defined for browser agents: So creating a new SRWebSocket object is the correct thing to do. Similar to how you don't re-use an NSStream object after it gets I do agree that it probably needs to be clarified a bit (and possibly some -Mike Michael Lewis On Fri, Feb 17, 2012 at 10:38 AM, Luke Redpath <
|
In my library, I have a connection object that wraps an SRWebSocket object.
When my app loses network activity and causes a disconnection, this bubbles up using delegation and I encourage people to use Reachability at this stage to check for network availability and if necessary, wait until it becomes available before reconnecting.
What I'm finding though, is that if the web socket disconnects due to a network error (to test, I'm simply pulling out my ethernet cable), I'm unable to re-use it. Calling
open
on it again doesn't appear to do anything. What I end up doing is creating a brand new socket instead.Is this expected behaviour?
The text was updated successfully, but these errors were encountered: