Disable delay in QAbstractSocket::waitForConnected

  • I need to disable connection delay in socket. Now If I enter wrong address, I should be waiting for 1 minute before error signal will emitted.
    Also I'm trying make so:

    client_socket->connectToHost(ip, port);
        if (client_socket->waitForConnected(-1))

    but application is not responding after running.
    I use OS X 10.11.1 and Qt 5.5.0

  • Lifetime Qt Champion


    The current timeout is 30 seconds. Since you are setting -1 the function will not timeout so your are blocking your application.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.