NetTalk Central

Author Topic: Trapping NetWebClient timeouts  (Read 11001 times)

Flint G

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • Email
Trapping NetWebClient timeouts
« 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
NetTalk: 12.26
Clarion: 9.1.11529
Brave: 1.31.88
Chrome: 95.0.4638.69
Edge: 95.0.1020.44
ExtJS: 7.0.0.156

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Trapping NetWebClient timeouts
« Reply #1 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.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Trapping NetWebClient timeouts
« Reply #2 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