         set { lock(); defer { unlock() }; _binaryType = newValue }
     }
     /// The current state of the connection; this is one of the WebSocketReadyState constants. Read only.
-    private(set) var readyState : WebSocketReadyState {
+    public var readyState : WebSocketReadyState {
+        get { return privateReadyState }
+    }
+    private var privateReadyState : WebSocketReadyState {
         get { lock(); defer { unlock() }; return _readyState }
         set { lock(); defer { unlock() }; _readyState = newValue }
     }

                }
            }
            defer {
                readyState = .Closing
            }
            for ;; {
                ws.readDeadline = NSDate().dateByAddingTimeInterval(60)

                    }
                }
                ws.close(closeCode, reason: closeReason)
                privateReadyState = WebSocketReadyState.Closed
                fireEvent(.Closed, code: closeCode, reason: closeReason, wasClean: closeClean)
            }
        }
        do {
            let ws = try WebSocketConn(self.request, services: TCPConnService(self.services.rawValue), protocols: self.subProtocols, compression: self.compression)
            wso = ws
            self.privateSubProtocol = ws.subProtocol
            fireEvent(.Opened)
            var pongFrames : [Frame] = []
            dispatch_async(dispatch_queue_create(nil, nil)) {
