[Qt-interest] Socket communication without threads
Predrag Manojlovic
pedjaman at gmail.com
Mon Mar 2 18:17:46 CET 2009
Scott Aron Bloom wrote:
>> Hi, you got me wrong :)
>>
>> Reason why i said "Only concurrent access" is because at least 100
> times
>> in list is mentioned that it is not necessary to use threads in
> socket
>> I know it is important. I used threads many times in my applications,
>> and i have 7+ years experience in C/C++ programming.
>> I'm aware of all possible problems regarding sync.
>>
>> How can I write network server (multiple connections at same time,
> like
>> chat server) without threads? That does not sounds possible.
>>
>>
>
> You should look through the examples...
>
> That said, since most of the QTcpSocket callsare not blocking (and
> actually wrap a qthread) its simply not necessary to use your own
> threads for the server
>
> Scott
Ok. I looked examples multiple times. Maybe I got something wrong. I
need one clarification:
Let me take Fortune Server as example (without threads):
And let replace fortune string with much larger data like file content.
If i start multiple clients, what will happen?
1. All downloading at same time?
2. One is downloading, other are waiting?
I thought that only one client is downloading data...
Thank you
Predrag
More information about the Qt-interest-old
mailing list