PDA

View Full Version : how to set timeout



mouni
10th November 2016, 07:13
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.....

anda_skoa
10th November 2016, 07:46
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,
_

mouni
10th November 2016, 07:51
no downloading just dispaly data

anda_skoa
11th November 2016, 18:18
no downloading just dispaly data

You were asking about timeout handling, now you are asking about displaying the data?
What kind of data?

Cheers,
_

mouni
14th November 2016, 05:09
timeout handling for displaying data

anda_skoa
14th November 2016, 08:24
Well, same thing really.
Start a timer, restart it when data arrives, act on it timing out.

Cheers,
_