hi,
i'm using tcpscocket & tcpserver in client & server connection.
I have only one client connecting to server.
When first time the application is launched the client is connecting to server, but if connection is disconnected then it is not reconnected . pls help . here is the code :

connect(tcpSocket, SIGNAL(disconnected()), this, SLOT(serverDisConnected()));

Qt Code:
  1. void mainwindow::serverDisConnected()
  2. {
  3.  
  4. tcpSocket->abort();
  5. tcpSocket->close();
  6.  
  7. tcpSocket->connectToHost("192.168.1.2",5000);
  8.  
  9. if(tcpSocket->waitForConnected(2000)){
  10. QMessageBox::information(this,"Client-Server Connection","Connected to Server");
  11. else
  12. QMessageBox::information(this,"Client-Server Connection","Client Disconnected ");
  13. }
To copy to clipboard, switch view to plain text mode