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. Howto activate the LowLatency on TCPClient on Windows
Forum Updated to NodeBB v4.3 + New Features

Howto activate the LowLatency on TCPClient on Windows

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 770 Views 1 Watching
  • 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.
  • A Offline
    A Offline
    adib taraben
    wrote on last edited by
    #1

    Hello,
    I am Using Qt5.13.0/win/MInGW64bit

    I try to setup LowLatency TCP Connection

    void MyInterface::socketConnected()
    {
        qDebug() << "socketConnected";
        QTcpSocket *socket = static_cast<QTcpSocket *>(QObject::sender());
        socket->setSocketOption(QAbstractSocket::LowDelayOption, 1);
    }
    

    But I encounter still a 10msec delay. After write I also do flush for the socket.
    When I check Socket Option then LowDelayOption is 1.

    please advice how to setup LowDelay on TCPClient socket.

    Thanks, Adib.

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @adib-taraben said in Howto activate the LowLatency on TCPClient on Windows:

      But I encounter still a 10msec delay.

      Are you calling flush() after write()?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      A 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        @adib-taraben said in Howto activate the LowLatency on TCPClient on Windows:

        But I encounter still a 10msec delay.

        Are you calling flush() after write()?

        A Offline
        A Offline
        adib taraben
        wrote on last edited by
        #3

        @Christian-Ehrlicher

        yes, I do

        byteswritten = socket->write(data, maxSize);
        socket->flush();
        qDebug() << "latency: " << socket->socketOption(QAbstractSocket::LowDelayOption);
        

        ... and when I check theoption; it is still set to 1.

        Adib.

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Reading the documenation I don't see why the delay should be below 10ms - it only tells the OS to flush as fast as possible. How do you measure. And since this is an OS specific option I don't think Qt can do anything for it (except flushing it's internal buffers so the OS can do it's work which you're doing).

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          3
          • A Offline
            A Offline
            adib taraben
            wrote on last edited by
            #5

            ah I forgot to mention:
            there is no difference noticable when there is LowDelayOption not set.

            Adib.

            aha_1980A 1 Reply Last reply
            0
            • A adib taraben

              ah I forgot to mention:
              there is no difference noticable when there is LowDelayOption not set.

              Adib.

              aha_1980A Offline
              aha_1980A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @adib-taraben

              Thats probably because LowDelayOption is something different than you expect.

              So again the question: what do you measure (and how) resp. what is too slow for you.

              Regards

              Qt has to stay free or it will die.

              1 Reply Last reply
              1

              • Login

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