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. Delay while using QTcpSocket.
Forum Updated to NodeBB v4.3 + New Features

Delay while using QTcpSocket.

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 533 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
    AmrMaatouk
    wrote on last edited by
    #1

    i have a TCP Server running on "Visual Studio" using "WinSock2" lib and client running on "Qt Creator" using "QTcpSocket" lib.
    and i have 2 fixed structs, one goes from the server to the client and the other from the client to the server.
    The problem is im having a ~= 1 Sec delay when i send a packet from the server "Visual Studio" to the client "Qt" ( everything works just fine when i send packets from the client to the server)
    i have tested the server with another small client Qt project (with the same QTcpSocket class files i used before ) it works just fine.
    but when i implement it with my Project, i get the 1 sec delay.

    so anyone can tell why i get that delay or how to find its reason in my code (using a debugging tool or something)
    Note: Both the Client Class and the GUI runs in the same thread. could it be the reason why i get these delay ?

    jsulmJ 1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      It is surprised. Either sending is the delay or receiving is the delay. Packet trace should be able to help you. Also you can try with both client & server in VC , both using Qt. In both the case, it will use WinSock2 only.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      2
      • A AmrMaatouk

        i have a TCP Server running on "Visual Studio" using "WinSock2" lib and client running on "Qt Creator" using "QTcpSocket" lib.
        and i have 2 fixed structs, one goes from the server to the client and the other from the client to the server.
        The problem is im having a ~= 1 Sec delay when i send a packet from the server "Visual Studio" to the client "Qt" ( everything works just fine when i send packets from the client to the server)
        i have tested the server with another small client Qt project (with the same QTcpSocket class files i used before ) it works just fine.
        but when i implement it with my Project, i get the 1 sec delay.

        so anyone can tell why i get that delay or how to find its reason in my code (using a debugging tool or something)
        Note: Both the Client Class and the GUI runs in the same thread. could it be the reason why i get these delay ?

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @AmrMaatouk You should show how you're sending data

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        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