Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Disable delay in QAbstractSocket::waitForConnected

    General and Desktop
    2
    2
    361
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Y
      yutkin last edited by

      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))
              qDebug("Connected!");
      

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

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

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

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • First post
          Last post