views:

67

answers:

2

I have been googling this, but I can't seems to find it.

Is there a QT way to use linux sockets? It looked like the QSocket class is used for network sockets and not for local linux sockets.

Anyone knows anything about this? And maybe a tutorial to get started?

+1  A: 

Look at 'Local Fortune Client' and 'Local Fortune Server', under IPC in the QtCreator demos. Those use QLocalSocket, which is a local domain socket in *nix.

ctd
+2  A: 

QSocket ? I think you're looking at the wrong Qt version :)

For the recommended Qt (4.6) there is QTcpSocket for TCP sockets. If you mean local domain sockets there is QLocalSocket.

http://doc.trolltech.com/main-snapshot/qtcpsocket.html

http://doc.trolltech.com/main-snapshot/qlocalsocket.html

Do not use a 0-timer and do not use threads. There is no need for that, you get notified with the readyRead() signal if there is new data.

guruz