Originally Posted by blue.death
The example was only in the QT 3.x series under networking examples, i just altered it to work in QT 4.x.
My understanding of the "waitForConnected()" function is that it's simply a delay to allow a handshake to occur, it doesn't actually do anything unless you want to establish a timeout (lets say for a server that's offline) and take the bool return to do error correction.
Basically it is a delay before completing the socket.
I removed the "waitForConnected()" from my client and it established a connection immediately, but my mail server is also on the company lan and connects extremely quickly.
Using the "waitForConnected()" function should have no effect on how you connect unless you choose to implement error correction based on it's return.
If you don't want to use it then i suggest putting a delay in, something like 10-15 seconds, which is close to a worst case connection delay for most internet applications.
Of course if you use "waitForConnected(15000)" then it will automatically stop the delay after either 15 seconds (a timeout) or you establish a connection (if it's less than the passed 15 seconds), which would make sense to minimize the time your application is waiting.
J
Bookmarks