[Qt-interest] readyRead() SIGNAL question

Thiago Macieira thiago at kde.org
Wed May 19 16:41:43 CEST 2010


Em Quarta-feira 19 Maio 2010, às 16:24:46, Alexander Carôt escreveu:
> Hi all,
> 
> I have connected the readyRead() SIGNAL of a QUdpSocket to a respective
> SLOT function:
> 
> connect(dFC->send, SIGNAL( readyRead() ), rec, SLOT( receiverSlot() ) );
> 
> In that context I discovered something strange: When running an application
> with numerous threads I have the impression that receiverSlot is not
> triggered as immediately anymore as without the threads. In that context I
> am wondering if the network receiverSlot is triggered with realtime
> scheduling priority or do I possibly need to apply additional calls in
> order to achieve that ?

There's no such thing as scheduling.

The signal is emitted as soon as data is read from the network, which happens 
when the event loop runs. If the event loop is prevented from running, for 
whatever reason, the signal will not be emitted.

You also mentioned threads, so it might be that you placed the object in the 
wrong thread, so you're facing two more problems: 1) the wrong event loop is 
doing the networking I/O and 2) the delivery of the signal goes through a 
queued connection.

I recommend you remove the threads.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100519/57a2354d/attachment.bin 


More information about the Qt-interest-old mailing list