PDA

View Full Version : when close QTextStream



mattia
23rd November 2007, 09:59
Hello,
I'm using a QTextStream to send some message from client to server, when i performed the operations should i close the QTextStream?
When i send the stream i'm into a "for" cycle, it's better close the QTextStream when all the "for" interations are ended?
Thx

wysota
24th November 2007, 13:17
You should close the stream to make sure all data gets written to the device. But note, that when you destroy the stream object, it syncs the device, so that no data gets lost. So in most cases you don't have to close the stream, because it'll be closed a while later.