I have a c# winform desktop app. It is checking for messages on my Server by invoking my [web method].
As I am in development this [web method] is not always available for my test client to use.
Nevertheless the client is still invoking this [web method].
I have noticed in this scenario (on my PC build) that CPU usage goes to 25%.
At the moment my [web method] is invoked on my client in a while(true)
loop. Subsequently, the [web method] is called recursively.
This while loop has been started by a new Thread.
I have a c# winform desktop app. It is checking for messages on my Server by invoking my [web method].
As I am in development this [web method] is not always available for my test client to use.
Nevertheless the client is still invoking this [web method].
I have noticed in this scenario (on my PC build) that CPU usage goes to 25%.
At the moment my [web method] is invoked on my client in a While(true) loop. Subsequently, the [web method] is called recursively.
This while loop has been started by a new Thread.
Thread _th = new Thread(MyLoop);
_th.Start();
void MyLoop()
{
while (true)
{
if (Disconnect)
{
return;
}
string[] _requests = Shared.WSconnector.GetRequests(Shared.ActiveMac);
//do something with these server requests...
}
}
Whilst the outage of my Web Services will hopefully be minimal it can obviously still happen.
How can i protect my client(s) from this CPU increase?
Thanks
Whilst the outage of my Web Services will hopefully be minimal it can obviously still happen.
How can i protect my client(s) from this CPU increase?