Results 1 to 5 of 5

Thread: Time taken in getting IP addresses

  1. #1
    Join Date
    Jan 2008
    Location
    Bengaluru
    Posts
    144
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Time taken in getting IP addresses

    Hi All,

    I have a priority in loading my application as fast as possible. So one of the steps which takes tangible time in seconds(rest are in ms) is getting the IP address. So here is the concern in time taken by a static method of QNetworkInterface for getting all the addresses.

    Qt Code:
    1. sActualIPAdd = QNetworkInterface::allAddresses().first().toString();
    To copy to clipboard, switch view to plain text mode 

    is taking 6 seconds in wireless network and 2 seconds in wired network. Is this can be reduced ?

    Thanks,
    Nikhil

  2. #2
    Join Date
    Jan 2011
    Location
    Gordion
    Posts
    52
    Thanks
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Time taken in getting IP addresses

    I have same problem.

  3. #3
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Time taken in getting IP addresses

    Does the IP change regularly? Or is it a fixed IP?

    Just store it in a file. It probably already is stored somewhere by the system itself.
    Then it is just reading it from that file.

    If it changes regularly, do the same (store the IP in a file) but run a process or thread in the background that regularly scans for a new IP.

  4. #4
    Join Date
    Jan 2011
    Location
    Gordion
    Posts
    52
    Thanks
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Time taken in getting IP addresses

    Thanks for reply. Its about QNetworkInterface. But if working machine have only 1 network interface (no wireless or bluetooth, just simply ethernet) there is no speed problem.

  5. #5
    Join Date
    Jan 2011
    Location
    Gordion
    Posts
    52
    Thanks
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Time taken in getting IP addresses

    I disabled the look up host section in code and now its working clearly.

Similar Threads

  1. Replies: 5
    Last Post: 19th November 2010, 02:25
  2. Replies: 1
    Last Post: 8th October 2010, 12:21
  3. Replies: 6
    Last Post: 18th August 2010, 12:52
  4. Replies: 1
    Last Post: 25th June 2010, 18:31
  5. check the time of last time keyboard is pressed
    By Aki Tomar in forum General Programming
    Replies: 2
    Last Post: 5th February 2008, 09:10

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.