square/SocketRocket — Issue #11: Re-connecting a disconnected socket
Author: lukeredpath
Created: 2012-02-17 18:38:23+00:00
State: open

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?