NetTalk Central

The Rest Of NetTalk => The Rest - Ask For Help => Topic started by: Flint G on May 10, 2011, 11:19:12 AM

Title: Trapping NetWebClient timeouts
Post by: Flint G on May 10, 2011, 11:19:12 AM
Hello NetTalkies,

There are two timeouts that I can see in a NetWebClient object: AsyncOpenTimeOut, and InActiveTimeOut.

Question1: When is each timeout used?  It would make sense to me that AsyncOpenTimeOut would be the timeout on opening a socket connection, and InActiveTimeOut would close an idle connection. 

Question 2: How/where do I trap each timeout to produce an appropriate error or dump out of the procedure?

Thanks!

Regards,
Flint
Title: Re: Trapping NetWebClient timeouts
Post by: kevin plummer on May 10, 2011, 03:57:13 PM
I have noticed recently in my payroll app whoch does a lot of backend calcs and table updating that if our internet is running slow that some browses embedded in forms will come back as no-records found. Click the calc button again and the records re-appear. Resetting our modem seems to fix the prob. I'm not sure if this is related to the Async timeout but it triggered the thought when I read your post.
Title: Re: Trapping NetWebClient timeouts
Post by: Bruce on May 10, 2011, 10:31:38 PM
AsyncOpenTimeOut  long
This is length of time in hs (hundreths of a second) after which the asynchronous open will timeout. Defaults to 9 seconds (900hs). Example use:
self.AsyncOpenTimeout = 200  !  2 seconds
or
self.AsyncOpenTimeout = 1000 ! 10 seconds

Tip: Although this property is measured in hs it will only timeout to an accuracy of a second.

If an Open fails, then the ErrorTrap method is called.

InActiveTimeOut  long

This is length of time in hs (hundredths of a second) after which an idle connection will timeout. When the timeout occurs a packet of packettype NET:SimpleIdleConnection will be sent to .Process()

Tip: Although this property is measured in hs it will only timeout to an accuracy of a second.

Cheers
Bruce