Skip to content
Advertisement

Using linux sockets the QT way?

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?

Advertisement

Answer

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.qt.digia.com/4.6/qtcpsocket.html

http://doc.qt.digia.com/4.6/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.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement