Hi
I am no expert but here are some of my thoughts:
You shouldn't use client.read() right after client.write(). Getting data over the network is asynchronous so you need to give it time to arrive.
If I were to guess, you are using QAbstractSocket as your client. If so, you should use its signal readyRead() to know when to read the answer.
This would explain why your program prints out your string only after you click a checkbox. At first pass of read_bytes() you don't have anything to read() as the answer have not arrived yet.
To set your checkboxes you will need to implement some queue, for example: isOn(0); readyRead()->setchecked()->isOn(1); readyRead()->setChecked()->isOn(2); and so on.
Hope it helps.




Reply With Quote

Bookmarks