PDA

View Full Version : Qsocket readyread() problem...



vani.pv
18th August 2012, 13:39
Hi...i am new to qt.....
i have an application in which i need to communicate with my pedestal through ethernet....For this i used qsocket..Everything goes well except readyread() signal.....


here is my code.......

connect(psock,SIGNAL(readyread()),this,SLOT(readda ta()));

writing to socket....

int bytsent =mysocket->writeblock(mybuff,mybuff.length();
if(bytsent != mybuff.length() )
MessageBox..........
else
QmessageBox:;information(this," ",readstr,QMessageBox::Ok);

...............
................

dataread()
{
while(!psock->canReadLine());
{
readstr = psock->readLine();
}


problem is while i am printing the message box for "readstr" in dataread() function it displays the correct data.
but if it is in "else" it is not showing the correct data..

so my doubt is is dataread() and else are running simultaneously or sequentially......
i dont know how much time it takes for reading.I need this readstr for further validations......


any solution appreciable........:)
thanku........