From kde-devel Sun Jun 13 22:27:57 2010 From: Robin Atwood Date: Sun, 13 Jun 2010 22:27:57 +0000 To: kde-devel Subject: Re: Howto read a named pipe with Qt4? Message-Id: <201006140527.58087.robin () binro ! org> X-MARC-Message: https://marc.info/?l=kde-devel&m=127646814901364 On Monday 14 June 2010, Robin Atwood wrote: > I have created a pipe with mkfifo which is driven by syslog-ng and want to > read it from my app. Searching always points me to QLocalSocket but when I > call 'connectToServer()' I get "ConnectionRefusedError". > > I tried QFile in Read/Write mode but got no output. I tried a standard > open() with O_RDWR+O_ASYNC+O_NONBLOCK and passed the fd to QFile but that > produces no output either. What is the secret to this? Ah, I finally found a useful hit. The trick is to use QSocketNotifier and the activated() signal and not QFile's readyRead(). Sorry for the noise! -Robin -- ---------------------------------------------------------------------- Robin Atwood. "Ship me somewheres east of Suez, where the best is like the worst, Where there ain't no Ten Commandments an' a man can raise a thirst" from "Mandalay" by Rudyard Kipling ---------------------------------------------------------------------- >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<