Please nominate your Qt Champions for 2021!

[SOLVED] Running multiple QTcpServers in the same app

  • 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)?


  • Lifetime Qt Champion


    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

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

  • Please give me solution with solved....Script

    'FileView' has not been declared

    void updateProgress(FileView* view, qint64 currentPos);

    expected ',' or '...' before 'state'

    void setButtonState(FileView::TransferState state);


    'Ui' does not name a type

    Ui::TransferWindow ui;


    template argument 1 is invalid

    QList<FileView> pendingSendList;


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


  • Lifetime Qt Champion

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

Log in to reply