Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Sockets joins contents!
MohammadReza last edited by
When I use two socket->write() immediately in the sender side, the receiver side receives mix of 2 content!
In the sender side:
In the receiver side I received "sth1sth1"!
But I want to receives "sth1" & "sth2" separately.
I need to this approach of sending contents.
How can I do it?
Tanks a lot.
Try to "flush":http://qt-project.org/doc/qt-5/qabstractsocket.html#flush the buffered data after the first write.
Using write like this, you get the correct result. If you want to get "sth1" and "sth2" as two different things you need to separate them using e.g. \n