square/SocketRocket — pull request #106 by mediumbear (2013-06-19 19:13:52+00:00)
Title: WebSocket never releasing, nor really closing.

Fix: memory leak and lack of actually closing the WebSocket.
Result: WebSocket is no longer retained indefinitely, delegate is notified of the closure, and the connection to the WebSocket server is severed.
Explanation: On sending a -[SRWebSocket close] message, the WebSocket server responds by echoing the close message back to us.
Nothing is done with this response. This can be verified by playing with the Chat test app.
Added setting _closeCode = SRStatusCodeNormal and sending -[SRWebSocket _disconnect] in -[SRWebSocket _innerPumpScanner]. This results in the various streams being closed, the delegate notified of the closure, and the severing of the actual connections to the WebSocket server.