[Interest] QNAM timeout is way too long
Thiago Macieira
thiago.macieira at intel.com
Tue Apr 22 03:09:59 CEST 2014
Em seg 21 abr 2014, às 14:02:05, Jason H escreveu:
> Well if you're going to the effort to create a timeout that isn't the 75s
> system timeout, why not make it a variable timeout?
Because this is a combined DNS + connection timeout, as opposed to a timeout
for each that you would get from the OS & libs.
And it was there when I arrived. It's not my doing.
And besides, it's not 75 seconds. It's 127 seconds, per IP address.
$ strace -r telnet 192.0.2.1 1024 |& grep -A1 connect.*192.0.2.1
0.000018 connect(3, {sa_family=AF_INET, sin_port=htons(1024),
sin_addr=inet_addr("192.0.2.1")}, 16) = -1 ETIMEDOUT (Connection timed out)
127.278591 write(2, "telnet: connect to address 192.0"..., 59telnet:
connect to address 192.0.2.1: Connection timed out
) = 59
If it's something with multiple IP addresses:
> This is one of those "640k ought to be enough..." moments. I can understand
> the rationale for Qt to set it the same on all platforms, so that you get
> consistent behavior. But if you're going to do that, you might as well make
> it a variable so its easier for the library user to leverage to their
> advantage.
30 seconds are enough for everyone :-)
> You could have made that something
> like: connectTimer->start( qApp->network()->connectTimeout() ) then
> supported a method to set it. i.e. qApp->network()->setConnectTimeout(long
> ms);
Indeed, we could make it configurable, like the double-click time is. Patches
welcome.
> I'm rather amused that when QNAM became part of the API, (April 2008, now 6
> years ago) We've gone from wired/802.11g to 2G (150kbps and seconds-long
> pings) to 3G to LTE with 10s of Mbps and 10s of ms pings. Qt was only
> targeting wired and wifi back then, now we're targeting wireless. Having a
> function manage the timeout would allow for each paradigm to targeted
> accordingly.
That has nothing to do with QNAM. The timeout is only for the socket to
connect. Once it's connected, there's no timeout.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Interest
mailing list