Thiago Macieira wrote: >        QTime timer; >        timer.start(); >        while (it.hasNext()) { >                d->socket.connectToHost(it.next(), port); >                int timeout = -1; >                if (d->timeout > -1) >                        timeout = d->timeout - timer.elapsed(); >                if (!d->socket.waitForConnected(timeout)) >                        break; >        } Hmm... if timeout becomes negative (i.e., timer.elapsed() > d->timeout for d->timeout != -1), you should also break out of the loop and provide a connection error condition. --   Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org     PGP/GPG: 0x6EF45358; fingerprint:     E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358