hi
What happens if readyRead() Signal is called while reading inside the funcion to which readyRead signal is connected.
hi
What happens if readyRead() Signal is called while reading inside the funcion to which readyRead signal is connected.
Assuming that you're using QObject::connect with the automatic connection type (which is the safest way, IMHO):
AFAIK, althought QHttp or QFtp implementations may be async, Qt signal/slots mechanism grants that the readyRead() connected slots won't be called in a overlapped fashion.
If the emitter and the receiver are on different threads, the connected slot will be queued to be called when the receiver "native" thread is activated, if they are on the same thread, one call to emit readyRead() would block untill all the connected slots are processed.
Note that on the different threads scenarion, the readyRead() could be called two times before the connected slot could have a chance of being called, so it would be wise to check for bytesAvailable() even on the connected slot.
Take a look at
http://doc.trolltech.com/4.4/threads...across-threads
for further explanations.
Bookmarks