[Qt-interest] QScoketNotifer sending both read and excpetions

శ్రీకాంత్ కావూరి srikanth.kavoori at gmail.com
Thu Feb 25 15:55:49 CET 2010


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.


Best Regards,
Srikanth.

More info :

1. the code which open the fd and connects it to he notifier handlers is
running in a  Qthread.

2. here is the configuration we did to the tty device

long flags;
struct termios ios;
int fd = open (ttydevice, O_RDWR | O_NOCTTY | O_SYNC);

flags = fcntl(fd , F_GETFL);
fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
tcgetattr(iUsbFd, &ios);
cfmakeraw(&ios);
tcsetattr(iUsbFd, TCSANOW, &ios)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100225/8609a97c/attachment.html 


More information about the Qt-interest-old mailing list