Hello everyone i did a server and a client, in loaclHost this programms work perfectly but when i change the localHost to my ip the Client no longer receive all the data, so i decide to rewrite the code. here is a part of my new code:
void fenPrincipal::test()
{
qDebug()<<tailleContenu<<"taille Contenu 1";
QDataStream in(actualSocket);
if (tailleContenu == 0)
{
if (actualSocket->bytesAvailable() < (int)sizeof(quint64))
return;
in >> tailleContenu;
qDebug()<<tailleContenu<<"taille Contenu";
}
a = actualSocket->bytesAvailable();
qDebug()<<actualSocket->bytesAvailable()<<"byte available";
if ( a < tailleContenu)
{
return;
}
else if (a>tailleContenu){
QString messageRecue;
in >> messageRecue;
qDebug()<<messageRecue<<"message";
tailleContenu=0;
}
}
and here is the debug informations:
1448 byte available
"Dragon Age: Inquisition -Du gameplay, des images et des détails" titre <- it's the second information send by the server
0 taille Contenu 1
2812 taille Contenu
1310 byte available
2812 taille Contenu 1
1460 byte available
2812 taille Contenu 1
2920 byte available
"" message
0 taille Contenu 1
30962754250670195 taille Contenu
1452 byte available
30962754250670195 taille Contenu 1
2912 byte available
30962754250670195 taille Contenu 1
4372 byte available
30962754250670195 taille Contenu 1
5832 byte available
30962754250670195 taille Contenu 1
6806 byte available
somebody can help tell my why it does'nt work and how make my client work ?