QTcpServer needs an event loop running. So does QTcpSocket.
QTcpServer needs an event loop running. So does QTcpSocket.
Actually, the QT documentation site says that both QTcpSocket and QTcpServer can be used without an event loop.
You must initialize timeout to false (see here) and you have to invoke QIODevice::waitForReadyRead() and QIODevice::waitForBytesWritten() in proper places to wait for data to be passed over the network.
jonging (20th June 2006)
Awesome, thanks a lot. I would never have been able to locate that QT bug. I still have a little trouble with the two other blocking calls because I get a segmentation fault. Do you have any idea what could be causing this?
Most segfaults are caused by dangling pointers. Use a debugger to see where it crashes and what parameters were passed to functions on the call stack.
Bookmarks