Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QNetworkAccessManager - finished signal (when emitted)
Forum Updated to NodeBB v4.3 + New Features

QNetworkAccessManager - finished signal (when emitted)

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 442 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RavensAngel
    wrote on last edited by RavensAngel
    #1

    I have a REST-service which i access using an HTTP POST. Using soap ui, i get timings like 30 ms. When using QNetworkaccessmanager (connecting the finished signal, direct connection) i get 230 ms.

    I used wireshark to check what is going on...

    What i see is that both ways are sending the same messages:

    • TCP SYN (time: 15.9528600)
    • TCP SYN, ACK (time: 15.9536980)
    • ACK (time: 15.9537440)
    • HTTP POST (time: 15.9549770)
    • HTTP REPLY (time: 15.9998710)
    • TCP ACK (time: 16.1998570) --> the time difference between the last HTTP reply and the ack is +/- 200 ms...

    The question is, is the finished signal emitted after the TCP ack in QNetworkAccessManager and can i force the signal to be emitted faster? Is it normal it waits to ack the reply before sending the finished signal? If so, is there another signal i can use to get the reply sooner?

    Or am I doing it wrong?

    Part of code:

    _am = new QNetworkAccessManager();
    connect( _am, SIGNAL( finished( QNetworkReply* ) ), this, SLOT( _requestFinished( QNetworkReply* ) ), Qt::DirectConnection );
    ...
    QNetworkRequest request( _requestData.url );
    request.setHeader( QNetworkRequest::ContentTypeHeader,"application/json" );
     _elapsed.restart();
    _reply = _am->post( request, _requestData.data );
    

    I time using QElapsedTimer just before doing the post and within the _requestFinished slot i take the elapsed time and output it.
    I always see 200+ ms...

    Any help? Or ideas?

    Thanks in advance.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved