>>Walter Meester wrote in one of his messages that he has the same issue. Because his customers are all over Europe, he - when carrying his computer somewhere - loses connection. He wrote of an approach that works for him. I use his approach. I have never seen a customer having to wait for the connection. Although I do see in the log that they would lose connection and then the application quickly reconnects (thanks to Walter's code).
>>My code that reconnects has the DO WHILE loop of 120 seconds. So far I have never seen this loop being executed to the end. Usually a second or two is enough. But I do want to continue using this DO WHILE loop. I just need to reduce the number of seconds from 120 to something more reasonable. Just in case.
>>I read your message that 2 seconds is an acceptable value. Just to be "conservative" I will change the 120 seconds to 10. At best, the application will never reach this time (10 seconds). But at worst, it may happen.
>>I have a log that monitors it.
>
>Fully concur with your current approach of logging and aim to make your code stable.
>I'd take less drastic program action, but instead refine your handling of "long wait".
>If your logging, customer messaging and proposed actions reflects "time spent"
>you will be prepared for things like server resets which your code cannot handle.
>
>So I'd leave the 120s in place, but shape reactions:
>if lnTime>lnNextStep
> do case
> case lnWait > 1200
> lnNextstep = lnNextstep + 300
> log_n_message(lnWait, lnNextstep, "Is your phone out as well?")
> case lnWait > 120
> lnNextstep = lnNextstep + 300
> log_n_message(lnWait, lnNextstep, "Strange... Call Dmitry if verified server is running and unchanged")
> case lnWait > 20
> lnNextstep = lnNextstep + 20
> log_n_message(lnWait, lnNextstep, "REALLY weird! Check if server is ok")
> case lnWait > 10
> lnNextstep = lnNextstep + 1
> log_n_message(lnWait, lnNextstep, "STILL no connection to Server? Recheck your internet access")
> case lnWait > 2
> lnNextstep = lnNextstep + 1
> log_n_message(lnWait, lnNextstep, "STILL no connection to Server? Check your internet connection")
> case lnWait > 0.1
> lnNextstep = lnNextstep + 0.1
> log_n_message(lnWait, lnNextstep, "No connection to Server? Wait! Program tries again")
> otherwise
> log_only("logging cont. disconnect ")
> endcase
>else
> log_only("connect reestablished")
>endif
>
>while hoping you never get such calls....
>
>my lazy way 2 look smart
>thomas
Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham