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. [SOLVED] Running multiple QTcpServers in the same app

[SOLVED] Running multiple QTcpServers in the same app

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.5k 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.
  • O Offline
    O Offline
    oh3netid
    wrote on last edited by
    #1

    Hello, I'm asking for some general advice.

    I have an app which needs to listen to two different ports. Each port serves a totally different function. Do I instantiate separate QTcpServers in order to serve these different ports, or is this considered bad form? If I am supposed to be using one QTcpServer, how do I specify multiple ports to listen to (without listening to all of them)?

    Thanks,
    -W

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      AFAIK, QTcpServer only listen to one port at a time.

      Since both servers will have different purposes, I would encapsulate each to separate clearly both functionality

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • O Offline
        O Offline
        oh3netid
        wrote on last edited by
        #3

        Okay, that sounds like a good idea. Thank you!

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ctsiitmail
          wrote on last edited by
          #4

          Please give me solution with solved....Script

          Warning...1
          'FileView' has not been declared

          void updateProgress(FileView* view, qint64 currentPos);

          Warning...2
          expected ',' or '...' before 'state'

          void setButtonState(FileView::TransferState state);

          Warning...3

          'Ui' does not name a type

          Ui::TransferWindow ui;

          Warning...4

          template argument 1 is invalid

          QList<FileView> pendingSendList;

          Warning...5

          request for member 'clear' in '((lmcTransferWindows*)this)->lmcTransferWindow::pendingSendList, which is of non-class type 'int'

          pendingSendList.clear();

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @ctsiitmail: please Stop spamming other people's thread with your unrelated questions. Open your own

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            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