     }
 
     private func isAuthenticationFailure(error: NSError?) -> Bool {
-        print("***** Authentication failure *****") // TODO: debugging
         guard let error = error,
               let description = error.userInfo[NSLocalizedDescriptionKey] as? String else
         {

    }

    private func connectWithToken() {
        guard !isConnecting else {
            return
        }

        guard retries < maxRetries else {
            let domain = "swift.WebSocketManager"
            let description = "Invalid HTTP upgrade. Please verify your credentials."
            let error = createError(domain, description: description)

    private let operations = NSOperationQueue()
    private let socket: WebSocket
    private var isConnecting = false
    private var isClosedByError = false
    private var retries = 0
    private var maxRetries = 2

