Results 1 to 2 of 2

Thread: What happens when the readyRead() signal is called while reading the data.

  1. #1
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default What happens when the readyRead() signal is called while reading the data.

    hi
    What happens if readyRead() Signal is called while reading inside the funcion to which readyRead signal is connected.

  2. #2
    Join Date
    Oct 2008
    Location
    Brazil, Sao Paulo - SP
    Posts
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: What happens when the readyRead() signal is called while reading the data.

    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.

Similar Threads

  1. Replies: 7
    Last Post: 29th August 2008, 10:24
  2. QWT 5, QT3, SuSE 10.2. Crash and burn
    By DrMcCleod in forum Qwt
    Replies: 8
    Last Post: 7th September 2007, 20:53

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.