         didDisconnect = false
         isConnecting = true
         createHTTPRequest()
-        isConnecting = false
     }
 
     /**

    private func doDisconnect(_ error: NSError?) {
        guard !didDisconnect else { return }
        didDisconnect = true
        connected = false
        guard canDispatch else {return}
        callbackQueue.async { [weak self] in

        let code = processHTTP(buffer, bufferLen: bufferLen)
        switch code {
        case 0:
            isConnecting = false
            connected = true
            guard canDispatch else {return}
            callbackQueue.async { [weak self] in
