Results 1 to 6 of 6

Thread: how to set timeout

  1. #1
    Join Date
    Sep 2014
    Posts
    94
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default how to set timeout

    i am using Qnetworkaccessmanager to get data from httpserver when server is not on how can check not connected it is taking time for 30sec to timeout i want to reduce 30sec to 10sec how i can check ...can anybody give the solution.....

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how to set timeout

    The only way to check if a server is reachable is to try to connect to it.

    If you want to cancel the operation before itself can finish based on a timeout, just create a timer with that timeout and connect it to the network reply's abort() slot.
    Also connect the downloadProgress signal of the reply to the timer's stop() slot to cancel the timer when data arrives.

    Cheers,
    _

  3. #3
    Join Date
    Sep 2014
    Posts
    94
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: how to set timeout

    no downloading just dispaly data

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how to set timeout

    Quote Originally Posted by mouni View Post
    no downloading just dispaly data
    You were asking about timeout handling, now you are asking about displaying the data?
    What kind of data?

    Cheers,
    _

  5. #5
    Join Date
    Sep 2014
    Posts
    94
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: how to set timeout

    timeout handling for displaying data

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how to set timeout

    Well, same thing really.
    Start a timer, restart it when data arrives, act on it timing out.

    Cheers,
    _

Similar Threads

  1. qextserialport timeout
    By wally123 in forum Qt Programming
    Replies: 0
    Last Post: 8th March 2012, 13:43
  2. QProcess timeout
    By MonkeyJLuffy in forum Qt Programming
    Replies: 8
    Last Post: 22nd April 2010, 12:42
  3. QHttp Timeout?
    By musaulker in forum Newbie
    Replies: 4
    Last Post: 25th February 2010, 09:43
  4. QBasicTimer never timeout.
    By kunalnandi in forum Qt Programming
    Replies: 5
    Last Post: 30th January 2010, 07:55
  5. Tootip Timeout
    By rajeshs in forum Qt Programming
    Replies: 1
    Last Post: 23rd July 2008, 10:17

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.