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. Slow TCP socket after quick succession of writes
Qt 6.11 is out! See what's new in the release blog

Slow TCP socket after quick succession of writes

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 1.2k 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.
  • E Offline
    E Offline
    EaccB
    wrote on last edited by
    #1

    Upon connection of QTcpSocket, I have 3 writes in succession. After this, there seems to be a noticeable delay in future messages being sent. I've been able to get around this by introducing a timer between the 3 writes, but want to understand what's causing this and how I can get around it.

    Ketan__Patel__0011K 1 Reply Last reply
    0
    • E EaccB

      Upon connection of QTcpSocket, I have 3 writes in succession. After this, there seems to be a noticeable delay in future messages being sent. I've been able to get around this by introducing a timer between the 3 writes, but want to understand what's causing this and how I can get around it.

      Ketan__Patel__0011K Offline
      Ketan__Patel__0011K Offline
      Ketan__Patel__0011
      wrote on last edited by Ketan__Patel__0011
      #2

      @EaccB

      Can you please provide the some more Details.
      I want to know what actually happening ?
      like You didn't get Response Properly
      Or You can't send the message properly

      1 Reply Last reply
      0
      • E Offline
        E Offline
        EaccB
        wrote on last edited by
        #3

        The message sends fine, and the response is received, but there is a noticeable delay between when write() is called, and the message is sent.

        1 Reply Last reply
        0
        • E Offline
          E Offline
          EaccB
          wrote on last edited by
          #4

          It seems to be the case that the message is sent every 3 writes.

          aha_1980A 1 Reply Last reply
          0
          • E EaccB

            It seems to be the case that the message is sent every 3 writes.

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

            @EaccB Please show a minimal example that exhibits the behavior.

            You can check the TCP transfer timing with Wireshark.

            Regards

            Qt has to stay free or it will die.

            1 Reply Last reply
            0
            • Ketan__Patel__0011K Offline
              Ketan__Patel__0011K Offline
              Ketan__Patel__0011
              wrote on last edited by
              #6

              Yes Can get the all details using Wireshark whatever Movements are happening on your TCPIP protocol
              just simply select your destination Address or Your Host Address

              1 Reply Last reply
              0
              • V Offline
                V Offline
                vladimir.litvinenko
                wrote on last edited by
                #7

                Perhaps everything is much simpler: you need to clear the socket buffer of the sent message. For a send stream connected to a socket, apply the flush method after a certain number of packets.

                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