The while loop is not the problem, as the cpu usage keeps normal when there is no remote connection.
Both applications are just the same. Both have got the same while loop in this case.
As metioned the connection should be used for remote support.
One cannot distinguish between client and server after connection has been established. If a user interacts with his local application, the interaction is reproduced on the remote peer's side and vice versa.
Works great so far 
As the main application code was not written by me I am not allowed to post original code here, sadly.
The while loop looks a bit strange... well, not my code 
someClass::buttonXYZClicked()
{
bool isOK=true;
...
this->show();
this->setActiveWindow();
while (isOK)
{
....
if(buttonCancel->isDown())
{
isOK=false;
}
...
Sleep(1);
...
}//END while
}//END someClass::buttonXYZClicked()
someClass::buttonXYZClicked()
{
bool isOK=true;
...
this->show();
this->setActiveWindow();
while (isOK)
{
QCoreApplication::processEvents();
....
if(buttonCancel->isDown())
{
isOK=false;
}
...
Sleep(1);
...
}//END while
}//END someClass::buttonXYZClicked()
To copy to clipboard, switch view to plain text mode
If I delete the processEvent call I cannot interact with the widget any longer.
As it is not my job to debug the main application I just do not want to hang around with the main code to much.
When I increase the value for sleep to a more realistic value, the problem is not that bad, but still there.
As written before, the problem is the same if both peers show the "same" modal QDialog with no user/socket activity in the meanwhile. The cpu usage increases and the remote peer crashes after a while anyway.
Bookmarks