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. How to implement TCP communication with QT
Forum Updated to NodeBB v4.3 + New Features

How to implement TCP communication with QT

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 191 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.
  • L Offline
    L Offline
    LISP
    wrote on last edited by
    #1

    Hello
    I am trying to implement multi-threaded tcp communication.
    Is it better to use a separate thread in the client program as well?
    Or is it better to do it on the main thread?
    Looking at the example, it seems that the server program uses a separate thread, but the client program does not normally use a thread.
    Should the client also use threads?
    Thank you for reading my poor English.

    jsulmJ 1 Reply Last reply
    0
    • L LISP

      Hello
      I am trying to implement multi-threaded tcp communication.
      Is it better to use a separate thread in the client program as well?
      Or is it better to do it on the main thread?
      Looking at the example, it seems that the server program uses a separate thread, but the client program does not normally use a thread.
      Should the client also use threads?
      Thank you for reading my poor English.

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

      @LISP said in How to implement TCP communication with QT:

      Is it better to use a separate thread in the client program as well?

      Only if really needed. Qt is assynchronous, so usually there is no need for additional threads. You only need threads if the main thread becomes too busy. But that is something you need to know or to test.
      How many connections do you want to maintain at the same time?
      If client has only one connection there is absolutelly no need for any threads.

      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