[Qt-interest] QScoketNotifer sending both read and excpetions
శ్రీకాంత్ కావూరి
srikanth.kavoori at gmail.com
Thu Feb 25 20:25:51 CET 2010
Hi Thiago ,
Thanks for the reply..
>>>> On Unix, the Read notifier
is triggered when errors are detected
So , how do we differentiate between an incoming data event to an errored
state of the socket we are listening to ?
we need to re-inititate or reset the port if the socket is in error state.
Thanks.
Best Regards,
Srikanth Kavoori
On Thu, Feb 25, 2010 at 6:19 PM, Thiago Macieira <thiago at kde.org> wrote:
> 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
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100225/c1a61daa/attachment.html
More information about the Qt-interest-old
mailing list