codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <QtCore/QFile> #include <QtCore/QDebug> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <assert.h> int main(int argc, char *argv[]) { assert(mkfifo("test.sock", O_RDWR | O_NONBLOCK) == 0); QFile f("test.sock"); f.open(QIODevice::ReadOnly | QIODevice::Unbuffered | QIODevice::Text); while(1) { if(!f.waitForReadyRead(6000)) continue; QByteArray ba = f.readAll(); qDebug() << ba; } return 0; }
Private
[
?
]
Run code
Submit