West Wind Internet and Client Tools
Windows Not Responding
Gravatar is a globally recognized avatar based on your email address. Windows Not Responding
  Julio Cesar Santone
  All
  Dec 21, 2021 @ 04:05pm

Hi,

When I submit a web service (wwJsonServiceClient::CallService) and takes too long to respond and the user click over the APP after 5 seconds, windows place a sign "Not Responding" on the form title.

How can I avoid that "Not responding" message to be shown by Windows 10 ?

Regards

Gravatar is a globally recognized avatar based on your email address. re: Windows Not Responding
  Rick Strahl
  Julio Cesar Santone
  Dec 21, 2021 @ 11:40pm

You can't. FoxPro is not multi-threaded and those calls are not made asynchronously.

Suggestion: Don't return an enormous amount of data that it takes so long for the app to lock up and instead return smaller chunks.

If you really need to return a massive amount of data like this then use wwHttp directly and use the async functions that can do this asynchronously. But wwJsonService is not set up to do this.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Windows Not Responding
  Julio Cesar Santone
  Rick Strahl
  Dec 22, 2021 @ 10:43am

Hi Rick,

It´s not about the amount of data but the occasional delay on the response by a multi server web service for example.

Thank's !

Regards

Gravatar is a globally recognized avatar based on your email address. re: Windows Not Responding
  Rick Strahl
  Julio Cesar Santone
  Dec 22, 2021 @ 03:48pm

You can't... other than what I mentioned in my last message using explicit async functions.

The solution is to fix the connection issue - no request should have to wait for 5 seconds to connect. If you have requests that take that long you should probably figure out why the delay is this long and add additional resources to reduce the delay. if it's a Web Connection application, maybe you need additional instances...

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Windows Not Responding
  Julio Cesar Santone
  Rick Strahl
  Dec 23, 2021 @ 07:09am

I consume external multi tier web services that takes between 10 and 15 seconds to respond. It's about medical authorizations that takes time because is a chain between 2 servers at least. Maybe, I don't explain myself, sorry. But I will try the async mode maybe that's the solution for this matter.

Thank's Rick

Regards

Gravatar is a globally recognized avatar based on your email address. re: Windows Not Responding
  Rick Strahl
  Julio Cesar Santone
  Dec 23, 2021 @ 12:18pm

Understood, but no application should be waiting synchronously for a request. Anything than more than a couple seconds is considered bad form, and requires some alternate async mechanism.

wwHttp wasn't explicitly designed for async functionality because it's native FoxPro code. The async features that it does provide are limited as it uses a different mechanism (in wwipstuff.dll). I've been thinking about adding a set of async functions using .NET but there are other issues with that approach that is not really ideal in FoxPro's environment (as nothing async really is).

FWIW, if you use wwDotnetBridge you can make async calls using InvokeMethodAsync() that basically lets you call async .NET functions (Task based) and get called back in FoxPro. This allows calling things like the .NET WebClient or HttpClient and use the async methods of these objects. There is an example of this in the wwDotnetBridge samples I believe in the samples folder.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Windows Not Responding
  Julio Cesar Santone
  Rick Strahl
  Dec 23, 2021 @ 12:28pm

Rick,

I'll take a look at your suggestions. Thank you for taking the time to make them.

Best Regards

© 1996-2022