Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Dec 11, 2019 1:50 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: HTTPSocket.Get Timeout taking exceedingly long
PostPosted: Tue May 22, 2012 11:54 am 
Offline

Joined: Mon Apr 20, 2009 1:29 pm
Posts: 20
I've observed some inconsistent behavior from the HTTPSocket class when there are network outages. Here is what I've found:

strINFInfo = socketINF.Get(strURL, 5) //Getting a simple 140 byte INF file from the server for software version checking

When used in synchronous mode, the socket will timeout correctly (in the specified Timeout period) when there is no network connection, but if there is a *network* connection, but no *internet* connection (e.g. if the cable/DSL connection is down but the router is working) the Get takes nearly a full minute to timeout.

I've noticed the identical behavior from the online Language Reference (i.e. right clicking a keyword in the RS editor will cause a minute long freeze when there is no internet connection) and suspect that it uses the same method of timing out.

Other than going through the effort of turning this into an asynchronous request is there any way around this obvious bug?

-bill k


Top
 Profile  
Reply with quote  
 Post subject: Re: HTTPSocket.Get Timeout taking exceedingly long
PostPosted: Tue May 22, 2012 3:42 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
wkoperwhats wrote:
I've observed some inconsistent behavior from the HTTPSocket class when there are network outages. Here is what I've found:

strINFInfo = socketINF.Get(strURL, 5) //Getting a simple 140 byte INF file from the server for software version checking

When used in synchronous mode, the socket will timeout correctly (in the specified Timeout period) when there is no network connection, but if there is a *network* connection, but no *internet* connection (e.g. if the cable/DSL connection is down but the router is working) the Get takes nearly a full minute to timeout.

I've noticed the identical behavior from the online Language Reference (i.e. right clicking a keyword in the RS editor will cause a minute long freeze when there is no internet connection) and suspect that it uses the same method of timing out.

Other than going through the effort of turning this into an asynchronous request is there any way around this obvious bug?

-bill k


I'd suggest you talk to the folks who defined the TCP/IP standards and ask them to change them then :)
It's actually not a bug - TCP/IP has a timeout which can be quite long all on it's own and may vary from OS to OS.
On some it's as long as 2 minutes before a request times out.

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: HTTPSocket.Get Timeout taking exceedingly long
PostPosted: Tue May 22, 2012 8:23 pm 
Offline

Joined: Mon Apr 20, 2009 1:29 pm
Posts: 20
npalardy wrote:
I'd suggest you talk to the folks who defined the TCP/IP standards and ask them to change them then :)
It's actually not a bug - TCP/IP has a timeout which can be quite long all on it's own and may vary from OS to OS.
On some it's as long as 2 minutes before a request times out.


So then how does the Timeout parameter for the Get method operate? If it's completely OS dependent, why even put it in? It seems like something wrong is going on.

And does this also explain the delay when right clicking in the RB editor? In the past I've made the mistake of force quitting RB because I didn't realize the it was simply taking a long time to time out. Give it a try, disconnect your cable modem (keeping your local network connection active), right click on a keyword and notice how long it takes for the IDE to time out from looking for the online help system. It's crazy.


Top
 Profile  
Reply with quote  
 Post subject: Re: HTTPSocket.Get Timeout taking exceedingly long
PostPosted: Tue May 22, 2012 10:39 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
The delay you are seeing is from name resolution and is independent of the Timeout parameter of the Get method. Name resolution occurs at the system level before the Get can even get going. The Timeout parameter takes effect after the socket is connected. If it takes the website too long to respond, it quits waiting after Timeout seconds.


Top
 Profile  
Reply with quote  
 Post subject: Re: HTTPSocket.Get Timeout taking exceedingly long
PostPosted: Wed May 23, 2012 3:38 pm 
Offline

Joined: Mon Apr 20, 2009 1:29 pm
Posts: 20
That makes sense, thanks for the explanation. I've always assumed the the Timeout was comprehensive and included all parts of the TCP/IP connection. It sounds like biting the bullet and turning the version checking module into a completely asynchronous mode of operation is the only way around this. Cheers.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group