From: "daniel åkerud" Date: 2007-12-30T04:02:42+09:00 Subject: Re: qt4 bindings, threads ------=_Part_31897_5222750.1198954968504 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Dec 26, 2007 7:22 PM, daniel =E5kerud wrote: > If anyone has the same problem in the future: I solved this problem by > using > a Qt::Timer, that polls the UNIX domain socket every 100ms. At every poll > it > reads data with socket.read_nonblock until it throws a Errno::EAGAIN, lik= e > this: > > 40 # poll data from socket, until there is no more > 41 begin > 42 begin # loop while read_nonblock returns data > 43 new_data, addr_arr =3D @socket.read_nonblock(128) > 44 data << new_data > 45 end while true > 46 rescue Errno::EAGAIN > 47 # no more data > 48 end > > Much cleaner than using a thread, IMO. > > /D > Update to this: QSocketNotifier is indeed they way to go. I think I tried Qt::QSocketNotifier instead of Qt::SocketNotifier by mistake earlier. /D ------=_Part_31897_5222750.1198954968504--