Results 1 to 3 of 3

Thread: Is internet connected

  1. #1
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Is internet connected

    Hey guys,

    From a Qt app,
    is there a simple way to check if we have access to the internet?

    Thanks.

  2. #2
    Join Date
    May 2009
    Location
    Gorontalo
    Posts
    200
    Thanks
    20
    Thanked 5 Times in 5 Posts
    Qt products
    Platforms
    Unix/X11 Windows

    Default Re: Is internet connected


  3. The following user says thank you to wirasto for this useful post:

    bunjee (22nd November 2009)

  4. #3
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Re: Is internet connected

    Qt Code:
    1. socket->connectToHost("hostName", portNumber);
    2. if (socket->waitForConnected(1000)) qDebug("Connected!");
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Play chess over the Internet
    By cwnelatury in forum Qt Programming
    Replies: 1
    Last Post: 3rd June 2009, 05:12
  2. The application with connected units.
    By kuzulis in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2009, 23:54
  3. Staying connected to a MySQL server
    By fnmblot in forum Qt Programming
    Replies: 1
    Last Post: 22nd November 2007, 10:39
  4. QSocket: connecting but not connected
    By olberg in forum Qt Programming
    Replies: 3
    Last Post: 8th May 2006, 10:26
  5. Check connecting to Internet
    By gtthang in forum Qt Programming
    Replies: 2
    Last Post: 17th February 2006, 17:13

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.