     private let authStrategy: AuthenticationStrategy
     private let operations = NSOperationQueue()
     private let socket: WebSocket
+    private var isConnecting = false
     private var retries = 0
     private var maxRetries = 1
 

    private func connectWithToken() {
        print("Connecting with token.") // TODO: debugging
        print("Retries: \(retries)") // TODO: debugging
        guard retries++ < maxRetries else {
            let domain = "WebSocketManager.swift"
            let code = -1

        if let token = authStrategy.token where retries == 0 {
            print("Using token: \(token)") // TODO: debugging
            self.socket.headers["X-Watson-Authorization-Token"] = token
            isConnecting = true
            self.socket.connect()
        } else {
            authStrategy.refreshToken { error in
