Results 1 to 7 of 7

Thread: Single server checking multiple client simultaneously - How to?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2014
    Posts
    12
    Thanks
    3
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Single server checking multiple client simultaneously - How to?

    Hi all,

    I'm trying to build a custom server which can check all the clients to check availability of them and gather some informations. All clients has their own webservers so I don't have to tackle with QTcpSocket. I'm just putting and get request via QNetworkAccessManager and waiting for the reply. When reply arrives, updating the GUI. And if someone select a client from gui I must serve latest informations about the selected client to the user.

    I'm trying to figure out how can it be done. I mean what type of struct should I use to accomplish that?

    Until now I've tried this way;
    - Read all client informations from database.
    - create a thread for each of clients.
    - send them required gui control pointers, so they can use these pointers to update their informations in runtime.

    But for example if I have 1500 clients then it means I have 1500 threads (WOW) and when all of them start to gather informations from clients at the same time 1500 get request will be done simultaneously. I wonder do I need 1500 threads? But after that I'm thinking that if I try to do this with a single thread all of the get requests will be done sequential and if I have 100 clients and do sequential request, if all of them reply with maximum timeout of QNetworkAccess::get method, then the user will wait (100 * maximumtimeout) secs to gather information all of them.

    How can it be accomplished via another way? I couldn't figure out.

    Thanks for help.

    Edit:
    In current status of the project, client object is subclassing QThread and reimplementing run() method. And another mainclass is creating one for each client and start it.
    Last edited by canavaroski90; 31st January 2014 at 17:13.

Similar Threads

  1. Replies: 3
    Last Post: 11th December 2012, 20:48
  2. Replies: 1
    Last Post: 3rd January 2012, 21:15
  3. Painting in multiple QWidgets simultaneously
    By edepetete in forum Qt Programming
    Replies: 0
    Last Post: 17th October 2011, 17:21
  4. Replies: 7
    Last Post: 10th May 2010, 11:26
  5. tcp QT server - .Net c# client
    By soniaerm in forum Qt Programming
    Replies: 0
    Last Post: 21st April 2010, 22:15

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.