×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    331

    Closing previously initiated requests using QNetworkAccessManager or QHttp!

    Hi...

    is it possible to close the previously initiated requests and activate the latest/current request using QNetworkAccessManager or QHttp?

    I just want the QNetworkAccessManager or QHttp class to disable/close the previously made requests and use the latest/current request for processing.

    Thanks...

  2. #2
    Regular Contributor
    Join Date
    Dec 2010
    Posts
    142

    Re: Closing previously initiated requests using QNetworkAccessManager or QHttp!

    Yes, use QHttp::abort () slot to do that.

  3. #3
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Closing previously initiated requests using QNetworkAccessManager or QHttp!


  4. #4
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    331

    Re: Closing previously initiated requests using QNetworkAccessManager or QHttp!

    But...As per Qt Reference Documentation:

    void QHttp::abort () [slot]
    Aborts the current request and deletes all scheduled requests.
    For the current request, the requestFinished() signal with the error argument true is emitted. For all other requests that are affected by the abort(), no signals are emitted.
    Since this slot also deletes the scheduled requests, there are no requests left and the done() signal is emitted (with the error argument true).

  5. #5
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Closing previously initiated requests using QNetworkAccessManager or QHttp!

    QHttp is deprecated and should not be used in newly written code.

  6. #6
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    331

    Re: Closing previously initiated requests using QNetworkAccessManager or QHttp!

    Ok. but QNetworkReply->abort also closes all connections!

    void QNetworkReply::abort () [pure virtual]
    Aborts the operation immediately and close down any network connections still open. Uploads still in progress are also aborted.

  7. #7
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    331

    Re: Closing previously initiated requests using QNetworkAccessManager or QHttp!

    My problem is that: I have a slider implemented, and as per the slider value I am trying to get Http data in XML format. So initially I restricted user to use the slider once untill all XML data are received.
    Now I just want to give the user the freedom to use the slider at any number of times. So if the user continuously drag the slider, then the slider will emit valueChanged(int) signal and as per that I'll pass the latest slider value data to the QNetworkAccessManager for further processing to get the Http XML data.
    For that all the previouly made requests should be closed or abondaned or terminated, so that only one i.e. the latest or current slider value data is passed as a request to the QNetworkAccessManager.

    Is it possible?

Similar Threads

  1. Replies: 2
    Last Post: 2010-11-17, 12:45
  2. How to upload file with QHttp?
    By wshiyc in forum Qt
    Replies: 2
    Last Post: 2010-07-22, 10:55
  3. QNetworkAccessManager or QHttp
    By gino.rossi in forum Qt
    Replies: 6
    Last Post: 2010-02-24, 09:12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×