[Qt-interest] Socket communication without threads

R. Reucher rene.reucher at batcom-it.net
Mon Mar 2 19:36:09 CET 2009


On Mon March 2 2009 19:32:56 Predrag Manojlovic wrote:
> R. Reucher wrote:
> > On Mon March 2 2009 18:27:04 Predrag Manojlovic wrote:
> >> I thought that only one client is downloading data...
> >
> > In fact, at some point the data is "serialized" anyway, and that's called
> > multi-plexing. There are better ways to do load-balancing if that's what
> > you are afraid of... of course you _CAN_ use QThread's to do what that,
> > but it makes live much harder and there's no real use for what you're
> > going to achieve.
> >
> > Instead, just respond to the signals of the QTcpSocket's... it's surely
> > fast enough for quite a number of concurrent clients.
>
> It is not balancing problem. I do not want clients to wait.
> So, if sendFortune() slot takes time (processing data etc) are other
> clients waiting? Or we have multiple sendFortune() instances running?
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.
-- 
René Reucher
rene.reucher at batcom-it.net
http://www.batcom-it.net/

Man is the only animal that blushes -- or needs to.
		-- Mark Twain




More information about the Qt-interest-old mailing list