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

QTcpSocket.connectToHost() takes too long time

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Out of scope
    • Affects Version/s: 5.9.0, 5.10.1
    • Fix Version/s: None
    • Component/s: Network: Sockets
    • Labels:
      None

      Description

      This is my code for connection with custom TcpServer (just simple main.cpp). 

      #include <QCoreApplication>
      #include <QDebug>
      #include <QTcpSocket>
      #include <QElapsedTimer>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
          qDebug()<<"START TEST!!!";
          QElapsedTimer timer;
          timer.start();
      
          QTcpSocket socket;
          socket.connectToHost(TcpIpAddress,80);
          qDebug()<<"connectToHost Done:"<<timer.elapsed();
      
          return a.exec();
      }
      

      Where "TcpIpAddress" is a random TcpIpAddress (for example "192.168.255.193")

      Result of tests:
      Qt 5.7.1: (this is normal)

      START TEST!!!
      connectionToHost Done:7
      

      Qt 5.9:

      START TEST!!!
      connectionToHost Done:2572
      

      Qt 5.10.1:

      START TEST!!!
      connectionToHost Done:2574
      

      Please refer to my question on stack overflow link

        Attachments

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

          Activity

            People

            Assignee:
            tpochep Timur Pocheptsov
            Reporter:
            roman_ozhegov Roman Ozhegov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes