Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Disable delay in QAbstractSocket::waitForConnected

Disable delay in QAbstractSocket::waitForConnected

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 471 Views
  • 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 Offline
    Y Offline
    yutkin
    wrote on last edited by
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved