         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)

        return request.URL!.description
    }
    /// A string indicating the name of the sub-protocol the server selected; this will be one of the strings specified in the protocols parameter when creating the WebSocket object.
    public var subProtocol : String {
        get { return privateSubProtocol }
    }
    private var privateSubProtocol : String {
        get { lock(); defer { unlock() }; return _subProtocol }
        set { lock(); defer { unlock() }; _subProtocol = newValue }
    }
