×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Dec 2009
    Location
    Switzerland
    Posts
    121

    QNetworkAccessManager + post, it is really slow by me

    Hi, I am using QNetworkAccessManager to send some data to my server.

    Nothing special:
    Code:
    QUrl url("http://myserver/sync.php");
        QNetworkRequest req(url);
        req.setPriority(QNetworkRequest::HighPriority);
        manager->post(req, send);
    send is a QByteArray with about 5kB-10kB of data (to update something on my database on the server)

    Every time I send this post, I have to wait for 30-40 seconds to get the answer from the server!

    - The upload of my router is about 150kb/s, so it should be uploaded in 1-2 seconds.
    - the php-script on my server need 1/2 seconds to process the request.

    If I download all data from my server (from database), it need 2 seconds. Why 30 seconds to upload?

    Is there a way to see why it need so much to get the reply? Or what can I do to speed up the query?

    On the simulator it is fast (1 to 3 seconds), on the phone it is really slow.
    I discovered Qt in the summer 2010, it was sooo easy and nice to use, that I begun to write some apps.
    Thank you Nokia, for giving me this possibility!

  2. #2
    Registered User
    Join Date
    Feb 2010
    Posts
    45

    Re: QNetworkAccessManager + post, it is really slow by me

    Are you testing just this function on the phone? Because the device connection manager has an idle timer. If you don't use the network for some minutes, the phone needs every time connect to the network. This could cause 30-40 second wait time.

  3. #3
    Registered User
    Join Date
    Dec 2009
    Location
    Switzerland
    Posts
    121

    Re: QNetworkAccessManager + post, it is really slow by me

    Quote Originally Posted by chriske86 View Post
    Are you testing just this function on the phone? Because the device connection manager has an idle timer. If you don't use the network for some minutes, the phone needs every time connect to the network. This could cause 30-40 second wait time.
    Yes, I know. On my app, there are 2 dialogs, and every time this dialog closes, the connection to the internet will be closed.
    On one dialog I have an upload function (a post request with 5kB of data), on the other one I have a download function (a get request with 10kB of downloads). To open the connection and download my data, I need not more than 5 seconds.

    If I upload some data, it need more than 30 seconds. If I upload it again, without close the dialog/connection, it need again 30 seconds.
    I discovered Qt in the summer 2010, it was sooo easy and nice to use, that I begun to write some apps.
    Thank you Nokia, for giving me this possibility!

Similar Threads

  1. Post values to server using HTTP POST
    By ramtrg in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2011-08-22, 11:34
  2. QNetworkAccessManager post image file
    By hclemson in forum Qt
    Replies: 7
    Last Post: 2011-07-01, 11:34
  3. Replies: 3
    Last Post: 2011-04-14, 15:37
  4. Replies: 5
    Last Post: 2010-09-25, 21:19
  5. slow slow Series_60_MIDP_Concept_SDK_BETA_0_3_1 emmulator
    By dd_plus in forum Mobile Java Tools & SDKs
    Replies: 5
    Last Post: 2004-08-09, 10:33

Posting Permissions

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