hashimov
6th February 2012, 09:06
Hi.
I wrote some programm which uses QTcpServer. I inherit some class from QTcpServer and in handleNewConnection method wrote something like this.
while (hasPendingConnections())
{
QTcpSocket* client = nextPendingConnection();
connect(client, SIGNAL(disconnected()), this, SLOT(clientDisconnected()));
}
in clientDisconnected() slot i wrote something, for example printf("disconnected");
And then i connect to this server using my Android Telnet client. When i connect to server using Windows Telnet client and then disconnected the clientDisconnected() method works and prints. But when i connect to Android Telnet client and then disconnect my phone from wifi, nothing prints, clientDisconnected() method not works.
I have write another program which recieves packets from gprs. When mobile phone can not send or no gprs connection with operatorServer does not disconnected old connection, and mobile phone tries connect again. Same problem in this case.
What is problem? Why is does not works?
I wrote some programm which uses QTcpServer. I inherit some class from QTcpServer and in handleNewConnection method wrote something like this.
while (hasPendingConnections())
{
QTcpSocket* client = nextPendingConnection();
connect(client, SIGNAL(disconnected()), this, SLOT(clientDisconnected()));
}
in clientDisconnected() slot i wrote something, for example printf("disconnected");
And then i connect to this server using my Android Telnet client. When i connect to server using Windows Telnet client and then disconnected the clientDisconnected() method works and prints. But when i connect to Android Telnet client and then disconnect my phone from wifi, nothing prints, clientDisconnected() method not works.
I have write another program which recieves packets from gprs. When mobile phone can not send or no gprs connection with operatorServer does not disconnected old connection, and mobile phone tries connect again. Same problem in this case.
What is problem? Why is does not works?