Qt-interest Archive, March 2008
Re: QSocketNotifier
Message 1 in thread
Hi Jim,
hce wrote:
> Can QSocketNotifier support serial port descriptor on Windows? Since I
> have troubled to make select() for serial port descriptor work on
> Windows, I am looking for alternative QT supports.
>
> Thank you.
> Kind Regards,
>
> Jim
recently we tried to figure out if it would be possible to use QSocketNotifier
for handling of serial port events. Someone has answered:
>> >
>> > we want to be notified about serial port receive events on a windows
>> > plattform ( Windows XP SP2, Visual Studio 2003, QT 4.3.0 ).
>> > we need the file handle for other classes, so we get the file descriptor
>> > by using _open_osfhandle.
>> > all is done without any error, but QSocketNotifier doesn't emit SIGNAL
>> > activated if any data arrives.
>> >
>> > is it a programming error or a windows problem?
>
> QSocketNotifier is implemented using the WinSock API, and I'm guessing that's
> why you don't see any activity, since you are passing a handle that is not a
> WinSock socket descriptor.
We solved the problem using additional thread with blocking I/O.
Regards,
Albert
--
[ signature omitted ]