[Qt-interest] Socket communication without threads

Predrag Manojlovic pedjaman at gmail.com
Mon Mar 2 20:27:43 CET 2009


R. Reucher wrote:
> On Mon March 2 2009 19:51:20 Predrag Manojlovic wrote:
>>> Just don't choose a block size of "several giga bytes" when sending data
>>> to the clients -- this would make the other clients wait. If you really
>>> need to send so much data, send it in smaller blocks... that's all there
>>> is to it.
>> Thank you for your answer.
>>
>> That is not too practical.
>> In that case i cannot send large file at once. I must send block,
>> maintain list of file objects for every client requested, etc...
>> That complicates code more then adding thread.
> Trust me, that's BEST practice!
> 
> Anyway, you should also take a look at QTcpServer which will take all the 
> hassle from you:
> http://doc.trolltech.com/4.4/qtcpserver.html

I readed documentation 100 times. I'm talking about TcpServer and looked
Fortune Server and Threaded Fortune Server examples.
I don't see that Threaded server is bad and more complicated.
To make threaded, you need 30 lines of code.
To maintain file objects you need at least same number of lines, and
code is much less readable.

What is bad there?



More information about the Qt-interest-old mailing list