babu198649
2nd December 2008, 07:58
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
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();
}
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
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
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();
}
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