Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reconnect TIWimer
#1
If the connection is lost ( bad Internet ), the timer does not recover when the connection reappears. How to resume the timer when the connection is active again ?

The timer is triggered 1 time per second. I use the method OnAsyncTimer.
Reply
#2
The timer should recover. ServerController.JavaScriptOptions.AjaxErrorMode controls how Ajax errors are handled on the browser side.

If you set it to emNone it will just ignore the erros and continue working, i.e. it will send request to the server, even if the prior request failed.

Can you please test it and let me know?
Reply
#3
(03-10-2019, 04:43 AM)Alexandre Machado Wrote: The timer should recover. ServerController.JavaScriptOptions.AjaxErrorMode controls how Ajax errors are handled on the browser side.

If you set it to emNone it will just ignore the erros and continue working, i.e. it will send request to the server, even if the prior request failed.

Can you please test it and let me know?

I set the setting ServerController.JavaScriptOptions.AjaxErrorMode to emNone from the beginning. Inside the timer OnAsyncTimer i use a "try except end" construct.
If to install brekpoint in the timer, after disconnecting the Internet cable, the timer stops calling the OnAsyncTimer, this is of course normal, but after returning the Internet cable back, the timer does not resume its work, you have to refresh the page in the browser.
Reply
#4
Hum... yes, you are correct.

The issue here is that the timer gets reactivated when processing the response. If the response fails, the timer doesn't get reactivated.

I'll have a look and see if I can find a workaround. I'll keep you informed, OK?
Reply
#5
I have some working code but I need to know your exact IW version in order to provide you a patch
Reply
#6
(03-12-2019, 09:32 AM)Alexandre Machado Wrote: I have some working code but I need to know your exact IW version in order to provide you a patch

IW 14.2.8
Reply
#7
Give me 1-2 days to prepare it.
Reply
#8
(03-13-2019, 11:05 AM)Alexandre Machado Wrote: Give me 1-2 days to prepare it.

Are there any options to solve this problem ?
Reply
#9
Porting to IW 14.2.8 showed more complicated than I first thought and I had to stop it to take care of other things. I'll see if I can proceed on it today and let you know.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)