Results 1 to 4 of 4

Thread: 500 clients support

  1. #1
    Join Date
    Mar 2006
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X

    Default 500 clients support

    From previous threads, maybe for Qt3:
    "For 500 clients I would rather use threads and QSocketDevice.
    QSocket can get quite slow at this load. "

    Is it still true for QTcpSocket in Qt4?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: 500 clients support

    Yes. This is because of the fact that with regular use QTcpSocket handles all connections in a single thread, meaning that it handles one connection at a time. Until a request is fully handled, no other request can be processed (and also all GUI events are handled by the same thread, meaning that network and GUI operations slow each other down). But you can use QTcpSocket in multiple threads. This way more that one client can be handled simoultaneously (in the meaning that for example waiting for data coming from a disk drive doesn't prevent other clients from being handled) and GUI events don't interfere that.

  3. #3
    Join Date
    Mar 2006
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: 500 clients support

    thanks,

    Is examples/network/threadedfortuneserver the example for your suggestion?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: 500 clients support

    It's fine. But you'll probably have to implement a more complicated thread model (for example storing threads in a queue) if you want the server to be really efficient.

Similar Threads

  1. Installation Problem
    By QbelcorT in forum Installation and Deployment
    Replies: 4
    Last Post: 22nd April 2010, 09:04
  2. Qt 4.4.3 commercial on Kubuntu 8.10
    By Micawber in forum Installation and Deployment
    Replies: 5
    Last Post: 17th February 2010, 01:02
  3. Cannot configure -platform win32-msvc2008, no nmake.exe
    By Jason Hamilton in forum Installation and Deployment
    Replies: 3
    Last Post: 1st September 2008, 10:05
  4. Qt-4.4.0 installation error in linux
    By babu198649 in forum Installation and Deployment
    Replies: 4
    Last Post: 27th May 2008, 14:35
  5. Access to PostgreSQL DB on a linux server
    By rmagro in forum Qt Programming
    Replies: 28
    Last Post: 13th March 2008, 09:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.