[Qt-interest] QScoketNotifer sending both read and excpetions

Thiago Macieira thiago at kde.org
Thu Feb 25 17:19:00 CET 2010


Em Quinta-feira 25 Fevereiro 2010, às 15:55:49, శ్రీకాంత్ కావూరి escreveu:
> Hi ,
> 
> 
> In Our Code , we have a usecase where we are supposed to listen to a tty
> device.
> 
> 
> So we do a standard Unix open (devicefilename, O_RDWR | O_NOCTTY | O_SYNC);
> 
> after we do some settings to initialise the tty port, like setting it to
> rawmode , and oher flags.
> 
> 
> Once we are done with this we create  2 scoket Notifiers with the same fd 
> , that we get from the above call.
> 
> When we receive some incoming data on the port , we are always getting Both
> Read and Excpetion Socket Notifiers. Infact there is a flood of notifiers
> even though we do a read.
> 
> Does any one know how we can avoid this flood ?
> 
> I expect the notifiers to be mutually exclusive. Like if there is an
> exception i expect only an exception notifier but not a read. which is not
> the case in our case.

Hi Srikanth

If you don't need the exception notification, don't use it. I have so far not 
found a real-world use case for it on Unix.

On Windows, apparently WinSock uses that for errors. On Unix, the Read notifier 
is triggered when errors are detected. (And Symbian uses the Windows behaviour 
instead of the Unix one in its Unix compatibility layer...)

As for the flood of reads, that's the expected behaviour. When it triggers, you 
must read everything.

Qt doesn't support Edge Triggers.
-- 
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/20100225/a5d7e544/attachment.bin 


More information about the Qt-interest-old mailing list