[Interest] QNAM timeout is way too long

Thiago Macieira thiago.macieira at intel.com
Tue Apr 22 03:26:27 CEST 2014


Em seg 21 abr 2014, às 18:09:59, Thiago Macieira escreveu:
> 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:

I forgot to wait for the command to finish:

$ time telnet a-multi.test.qt-project.org 1024         
Trying 192.0.2.1...
telnet: connect to address 192.0.2.1: Connection timed out
Trying 192.0.2.2...
telnet: connect to address 192.0.2.2: Connection timed out
Trying 192.0.2.3...
telnet: connect to address 192.0.2.3: Connection timed out
telnet a-multi.test.qt-project.org 1024  0,00s user 0,00s system 0% cpu 
6:21.68 total

It took 6:21 minutes for this command to finish.

With QTcpSocket, it runs in 3 minutes and tries each IP address twice:

$ time strace -re connect ./a.out
     0.000000 connect(5, {sa_family=AF_INET, sin_port=htons(1024), 
sin_addr=inet_addr("192.0.2.1")}, 16) = -1 EINPROGRESS (Operation now in 
progress)
    30.024752 connect(4, {sa_family=AF_INET, sin_port=htons(1024), 
sin_addr=inet_addr("192.0.2.2")}, 16) = -1 EINPROGRESS (Operation now in 
progress)
    30.029888 connect(4, {sa_family=AF_INET, sin_port=htons(1024), 
sin_addr=inet_addr("192.0.2.3")}, 16) = -1 EINPROGRESS (Operation now in 
progress)
    30.018024 connect(4, {sa_family=AF_INET, sin_port=htons(1024), 
sin_addr=inet_addr("192.0.2.1")}, 16) = -1 EINPROGRESS (Operation now in 
progress)
    30.031005 connect(4, {sa_family=AF_INET, sin_port=htons(1024), 
sin_addr=inet_addr("192.0.2.2")}, 16) = -1 EINPROGRESS (Operation now in 
progress)
    30.014966 connect(4, {sa_family=AF_INET, sin_port=htons(1024), 
sin_addr=inet_addr("192.0.2.3")}, 16) = -1 EINPROGRESS (Operation now in 
progress)
    30.032129 +++ exited with 1 +++
strace -re connect ./a.out  0,01s user 0,02s system 0% cpu 3:00,17 total

PS: the timeout is actually 30 ± 1 s, due to the VeryCoarseTimer 
functionality.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 267 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140421/6ce8a37b/attachment.cpp>


More information about the Interest mailing list