Thank you for your reply Lesiok. I tried your suggestion, please see the code below. Now the problem is that the password does not get appended for some unknown reason. So, immediately after appending the 0x00 byte the password is also appended but for some reason the server doesn't read it.
{
qDebug() << "Connected to server"<<endl;
dataArr.append(loginDetails.at(0));
dataArr.append(tempByte);
dataArr.append(loginDetails.at(1));
socket->write(dataArr);
}
if(socket->state() == QAbstractSocket::ConnectedState)
{
qDebug() << "Connected to server"<<endl;
QChar tempByte = 0x00;
QByteArray dataArr;
dataArr.append(loginDetails.at(0));
dataArr.append(tempByte);
dataArr.append(loginDetails.at(1));
socket->write(dataArr);
}
To copy to clipboard, switch view to plain text mode
Seems to work just fine when I use a different byte like 0xFF, do you perhaps know why this is?
Bookmarks