Yeah I noticed that during testing and now I'm a little stomped. I guess there is no asynchronous implementation of that function ?
Yeah I noticed that during testing and now I'm a little stomped. I guess there is no asynchronous implementation of that function ?
Affenbrotbaum (19th January 2011)
Hehe ok now I'm confused. The above code in post #6 is what's connected to the readyRead() signal. Only 2 differences are a) The QDataStream now gets created once per socket when I'm working through the TcpServer::hasPendingConnections() list and b) I limit the data being received since I know all the strings and their length that are permitted to be submitted (socket->bytesAvailable()). I just had for testing purposes a waitForReadyRead() in there to see how it behaves with large or no data coming in.
So far, everything seems to be working now. I'll post some code this weekend so other people have an example of this whole conversation. Thank you very much for all the help
Cheers
Alex
That's correct and that's the right approach. But the code you put inside the slot connected to this signal is relevant.
And that's your problem. You assume the data is going to look like you expect it. A good server is not one that behaves correctly for the data it expects, that's easy to achieve. A good server behaves correctly for the data (and behaviour) it doesn't expect.b) I limit the data being received since I know all the strings and their length that are permitted to be submitted (socket->bytesAvailable()).
Such tests are useless.I just had for testing purposes a waitForReadyRead() in there to see how it behaves with large or no data coming in.
So far, everything seems to be working now.
With the code you posted so far I can compromise your whole server computer (not only your application) within seconds.
Bookmarks