Good day. There is a project in which QTcpSocket is used and it looks like this in the general case:
QTcpSocket *Q_socket = new QTcpSocket(this); Q_socket->setSocketOption(QAbstractSocket::LowDelayOption, 1); if (Q_socket == NULL) { return error ;// сокет не открылся } for (int cnt = 0; cnt < send_sequence_length; cnt++) // { //заполняем массив на отправку data_send[to_send_counter] = to_send_array[cnt]; to_send_counter++; //когда он заполнился if (to_send_counter == 32) //Отсылаем по 32 { send_error = Q_socket->write((char*) &data_send, 32*sizeof(ToSend)); if (send_error == -1) { return error = -5; //ошибка приёма/передачи } to_send_counter = 0; } } RecData = Q_socket->readAll(); Q_socket->close(); Q_socket->waitForDisconnected(); The problem is that when reading it, it returns nothing - RecData remains empty. When setting a breakpoint, it will only send a small number of packets, and after continuing with the program, the rest will not return anything when reading. In this case, all the packages reach the addressee, this is confirmed on the receiving side. How should the data be read, with what delay, or in general to open another socket for this?