Hi all,

I have made a multithreaded server that sends client the updates
of its desktop. Server uses a seprate thread that gets updates
and then send them to client through socket. I have used
an infinite while loop in that thread that breaks when client disonnects
and in each iteration of loop i get updates and sends if there is any.
After sending one update i have used a Sleep of 50ms so that there
should be a delay in next update send. If i dont used the sleep then
server thread will continuously get screen updates and sends them.
This causes my CPU usage on server near to 100%. To avoid this i have used
sleep. Is that sleep duration is ideal or poor approach?
Or i can use more sleep duration.

I havent any idea how much sleep is ideal in real time applications.