Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Oct 2011

    [moved] Qt Networking APIs


    I am using Qt n/w APIs ( QNetworkAccessManager , QNetworkRequest,QNetworkReply)from a console app to do a HTTP post to a server on Symbian device. The console app launches periodically sends a post/get command , receives the response from server does some handling of that and then exits.

    Suppose there is no connectivity and the console app try to do a post OR get to the server , then my console exe is not getting back any response OR error and my app always keeps on running.. is there a way that can be used to check if a connection can be made.. if not then don't initiate a get/post OR exit immediately.?


  2. #2

    Re: [moved] Qt Networking APIs


    I think it is more reasonable to make GET and POST request and get error result. Technically there is no safe way to know if request can be made because system can be configured in many unexpected ways and can fail at various stages. Some examples:
    1) You could check if network interfaces are up and make request only if they are up. It will be really hard to make that cross-platform and user might have interesting network configuration where connections are made through some unusual local proxy.
    2) If some router went down between user and server again your request will fail. Checking if server is accessible is not safe because it might go down immediately after your check.
    3) Lastly you should check if server is up and running. Again ping might be not an option because ping might be prevented by firewall.

    I'm pretty sure it is possible to add timeout to your request and inform user that operation has failed because applications has not managed to perform operation because of timeout.

Similar Threads

  1. Guidance needed for Networking APIs for Nokia 6303 device running on S40 6th edition.
    By shuklamanish in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2011-05-06, 20:54
  2. [Moved] Symbian APIs
    By jas76 in forum General Development Questions
    Replies: 7
    Last Post: 2008-09-15, 18:08
  3. [Moved] Networking for dummy
    By sld123 in forum General Development Questions
    Replies: 2
    Last Post: 2008-09-02, 09:18

Posting Permissions

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