I am trying to connect to server using QTCPSocket::connectToHost. On WinCE and s60 devices. If I uses comparitively high network protocols(WiFi), is goes well.

But when I uses slow network protocols (gprs, hspda, umts, edge). It fails in connection.
Does anyone here face this issue, using QTCPSocket ?

Qt Code:
  1. #include <QApplication>
  2. #include <QMessageBox>
  3. #include <QTcpSocket>
  4.  
  5. //#define API_URL "www.google.com"
  6. #define API_URL "64.233.189.99"
  7.  
  8. int main(int argc, char *argv[])
  9. {
  10. QApplication a(argc, argv);
  11. QTcpSocket sock;
  12. sock.connectToHost(API_URL, 80);
  13. if(!sock.waitForConnected())
  14. {
  15. QMessageBox::information(0,0,"Failed");
  16. return false;
  17. }
  18. QMessageBox::information(0,0,"Connected");
  19. return 0;
  20. }
To copy to clipboard, switch view to plain text mode