QByteArray sendP = forSend(); QDataStream out(&sendP, QIODevice::WriteOnly); out << (quint16)0; out.device()->seek(0); out << (quint16)(sendP.size() - sizeof(quint16)); m_ClientSocket->write(sendP); // это место должно проверяться
QByteArray sendP = forSend(); QDataStream out(&sendP, QIODevice::WriteOnly); out << (quint16)0; out.device()->seek(0); out << (quint16)(sendP.size() - sizeof(quint16)); if(!(m_ClientSocket->write(sendP))) { ... //Error }