PDA

View Full Version : read and write on qtcpsocket



dognzhe
2nd June 2009, 09:07
My question is :

is that possible to do the write and read operation on same socket?
are them going to conflict each other?

how to do it?

^NyAw^
2nd June 2009, 09:42
Hi,

Yes, it is possible and there will be not conflicts.
You can use QDataStream, QTextStream or QIODevice::read and QIODevice::write. It depends on how the data will be sent.
Also you have to connect the "readyRead" SIGNAL of the socket to receive the data.
Take a look at Qt network examples.