Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-37678

On Windows 7, QTcpSocket::waitForConnected(x) doesn't take into account the timeout given (x), and always waits (blocks) for 30-40 seconds.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.0.2, 5.2.1
    • None
    • Windows 7 Ultimate, 32 bit

    Description

      In the following code snippet, under Windows 7 (32-bit), waitForConnected(5000) waits about 30-40 seconds instead of 5. Under Xubuntu, the issue doesn't show up, and it waits only 5 seconds.

      #include <QCoreApplication>
      #include <QTcpSocket>
      int main(int argc, char *argv[])
      {
      QCoreApplication a(argc, argv);

      QTcpSocket socket;
      qDebug() << "connecting";
      socket.connectToHost("192.168.78.234" , 2000);
      qDebug() << "wait for connect return " << socket.waitForConnected(5000);

      return a.exec();
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            richmoore Richard Moore (qtnetwork)
            iavor25 iavor karakashev
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes