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?
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?
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.
thanks,
Is examples/network/threadedfortuneserver the example for your suggestion?
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.
Bookmarks