[Qt-interest] Socket communication without threads

Sean Harmer sean.harmer at maps-technology.com
Mon Mar 2 18:53:02 CET 2009


On Monday 02 March 2009 17:27:04 Predrag Manojlovic wrote:
> Hm... let me explain problem on better example:
>
> 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...
>From the docs for QIODevice from which QTcpSocket is derived:

"Certain subclasses of QIODevice, such as QTcpSocket and QProcess, are 
asynchronous. This means that I/O functions such as write() or read() always 
return immediately, while communication with the device itself may happen when 
control goes back to the event loop."

Does that explain it?

Sean





More information about the Qt-interest-old mailing list