1. Roland Smith
  2. PowerBuilder
  3. Friday, 9 June 2023 19:39 PM UTC

My app (PB 2019-R3) uses HttpClient to make web service calls. I have AutoReadData = False so I am using ReadData to return the results. The sending of the request is done with PostDataStart/PostData/PostDataEnd.

In general it works great but occasionally when a user's computer goes into hibernation and wakes up or the network 'blips', the app will get a 'General Error' from the next PostDataStart or ReadData.

I suspect it might have to do with Keep-Alive. I could turn it off at the server in the 'HTTP Response Headers' section of IIS Manager. This would theoretically make regular operation slower.

Would it be better to just add in a retry feature - try the function again before reporting an error to the user.

David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Tuesday, 13 June 2023 09:44 AM UTC
  2. PowerBuilder
  3. # 1

Hi Roland

We have certainly done retries to build resilliance in the comms layer, so no harm in doing that. Also when the PC hibernates I gues the connection is really terminated.

I guess you are using your wonderful service for this, so you probably do not know that he PC has been put into hibernation. It would be useful if a hibernate function could be called then you could stop operations in an orderly manner, and then start them when you get the next run function.

Let me know if we can be of more help.

Regards

David

 

Comment
  1. Roland Smith
  2. Tuesday, 13 June 2023 12:27 PM UTC
There are events around the hibernate process, they would have to be captured in the Other event. The other developer of the app is on vacation so when he gets back, I'm going to suggest using SetThreadExecutionState before the web service call to tell Windows to not hibernate and then call it again after the call returns to let it know it is okay to hibernate.
  1. Helpful 1
  1. David Peace (Powersoft)
  2. Tuesday, 13 June 2023 12:38 PM UTC
We use a boolen to tell the long process to break and come out for stop etc. The stop wait til the main process confirms it's ok with another boolean. i.e. pleasestop and oktostop.

Just food for thought, but what you are suggesting should work well too.



  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 12 June 2023 14:28 PM UTC
  2. PowerBuilder
  3. # 2

I'm going to try using SetThreadExecutionState to prevent sleep mode in parts of the app that make long running web service calls.

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 9 June 2023 21:37 PM UTC
  2. PowerBuilder
  3. # 3

When computer goes into Hybernation, it's basically shut down if I'm not mistaken, so I'm not surprised.

When it goes into "sleep mode", I'd expect things to keep running, but would not be surprised if not.

regards

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.