hi
i have a file which has floating values written in text format .so i have to use QTextStream to read the file and send it to socket repeatedly.
Here the code
while(1)
{
while(!in.atEnd())
{
double c;
in>>c;
char *data = (char*)(&c);
socket->write(data,8);
socket->flush();
}
in.seek(0);
}
QTextStream in(&file);
while(1)
{
while(!in.atEnd())
{
double c;
in>>c;
char *data = (char*)(&c);
socket->write(data,8);
socket->flush();
}
in.seek(0);
QCoreApplication::processEvents();
}
To copy to clipboard, switch view to plain text mode
It is supposed to send the file continously ,But the file is send just once and then it stops .What is wrong in the code.
Thank u
Bookmarks