client (c ++, qt)
Код: Выделить всё
void ServerConnector::slotSendToServer(const QString& info_)
{
QString request_;
if(info_ == "GET_ID")
{
request_ = jsonWorker_.createJsonGET_ID(info_);
}
QByteArray data_ = request_.toUtf8();
qDebug() write(reinterpret_cast(&lenght_), sizeof(lenght_));
socket_->write(data_);
socket_->flush();
socket_->waitForBytesWritten();
qDebug()
Подробнее здесь: [url]https://stackoverflow.com/questions/79422994/the-problem-with-receiving-requests-to-the-server-from-the-c-client[/url]