Results 1 to 9 of 9

Thread: Check network connection

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Check network connection

    I'd suggest you to use
    Qt Code:
    1. socket->connectToHost("hostName", portNumber);
    2. if (socket->waitForConnected(1000))
    3. qDebug("Connected!");
    To copy to clipboard, switch view to plain text mode 
    .
    In this method, you can try connecting to a valid host to a period of time and if it succeeds then fine otherwise time out will occur. The value of trying time is in your hands.
    Last edited by yogeshgokul; 6th November 2009 at 08:59.

  2. The following user says thank you to yogeshgokul for this useful post:

    sophister (6th November 2009)

Similar Threads

  1. Replies: 12
    Last Post: 22nd March 2009, 11:22
  2. QFtp with no network connection
    By josepvr in forum Qt Programming
    Replies: 0
    Last Post: 19th November 2008, 15:03
  3. SQL connection closure problem.
    By cbarmpar in forum Qt Programming
    Replies: 1
    Last Post: 8th September 2008, 08:42
  4. Checking network availability
    By fullmetalcoder in forum Qt Programming
    Replies: 2
    Last Post: 10th March 2008, 19:23
  5. Client/Server Error: BadIDChoice
    By 3nc31 in forum Qt Programming
    Replies: 5
    Last Post: 27th November 2007, 10:22

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
  •  
Qt is a trademark of The Qt Company.