[Kde-bindings] Ruby + QSocketNotifier on Windows

Max Cantor max at maxcantor.net
Tue Oct 4 01:25:22 UTC 2011


I'm writing a cross-platform Ruby 1.9.2 app using Qt4 via the qtbindings
gem.  I'm using a QSocketNotifier to read newline-delimited data from a
persistent connection, and it's functioning as expected on Linux and OS X.
 However, the activated() signal never seems to be firing when I test on my
64-bit Windows 7 machine.

The code which sets up the notifier is here: http://pastebin.com/Hn9MKGqm

In this case, "client" is a Client object I wrote.  Client#read is simply
"@sock.gets".

I've tried this with and without the "socket.enabled = true/false" at the
start/end of the block.  Other signals are firing successfully, including
the one that triggers the event which reads input from a text box and sends
it to the server!  I have verified on the server side that the client is
writing to it successfully.  However, that activated() block just never
happens.

My only current hunch is that perhaps Ruby sockets are not implemented with
the WinSock API on Windows, which I read somewhere is required for usage
with QSocketNotifier.  If that's the case, I'm not sure what ought to be
used instead.  At first I thought this was some kind of thread scheduling
problem, but since other events are working as expected, that seems
unlikely.

Any ideas?

 - Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20111003/dc7f9676/attachment.html>


More information about the Kde-bindings mailing list