Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-14-2004, 02:08 AM
Member
 
Join Date: Jun 2003
Posts: 39
Default Lost requests when connection lost

I have a script that regularly (3 secs) does a load() on a LoadVars() object which works fine (gets a reply) while the network is up, BUT if the network connection is lost (ie. cable unplugged) Flash takes a long time (30 secs+ before it even starts sending requests again) even though the network connection is back up within this time (ie. web browser can fetch webpages).

I have watched the network traffic using Ethereal.

Does anyone know of a way that I can get Flash to start sending requests as soon as the network connection returns (ie. not 30 secs+ later)?
Reply With Quote
  #2 (permalink)  
Old 05-17-2004, 03:26 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Lost requests when connection lost

I guess the load method has a timeout interval about 30+ seconds. When you get online in 30 secs, the load method doesn't return until the timeout interval elapses and the next call is omitted.

You can call the "Inet.IsInetConnected" method to see if you're online every 30 secs. If you're offline, stop the processing. otherwise, start the processing again.

I'm not sure if it can work. If you have a solution, please tell us, thanks.
Reply With Quote
  #3 (permalink)  
Old 05-24-2004, 12:42 AM
Member
 
Join Date: Jun 2003
Posts: 39
Default Re:Lost requests when connection lost

From the help manual for 'IsInetConnected' says:

Code:
This method determines the Internet connection state by pinging the site www.swfkit.com.
Is this true?

This is not reliable.

1. This is can not be used to determine a network connection, only an open internet connection. What if this URL or UDP traffic is blocked? An incorrect status will be returned.

2. Or even what if your server/net connection/DNS went done? The apps assumption would be that the internet is not available. I remember atleast once that I was unable to surf to the SWFKit website.

Can't this be changed to detect if Windows thinks it has a network (not "internet") connection?
Reply With Quote
  #4 (permalink)  
Old 05-24-2004, 06:39 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Lost requests when connection lost

IE 4+ provides a function can get the status of the network

Code:
Dll.registerFunction(
"wininet.dll", //library name
"InternetGetConnectedState", // function name
"getConnectedState", //alias in SWFKit
"stdcall",//call type
"long",//return type
"ulong*", //param 1
"ulong", //param 2
);

var inetState = new Object;
inetState.value = 0;

if (getConnectedState(inetState, 0))
{
trace(inetState.value);
//inetState.value can be a combination of the following values

//INTERNET_CONNECTION_CONFIGURED = 0x40
//Local system has a valid connection to the Internet, 
//but it might or might not be currently connected.

//INTERNET_CONNECTION_LAN = 0x02
//Local system uses a local area network to connect to the Internet.

//INTERNET_CONNECTION_MODEM = 0x01
//Local system uses a modem to connect to the Internet.

//INTERNET_CONNECTION_MODEM_BUSY = 0x08
//No longer used.

//INTERNET_CONNECTION_OFFLINE = 0x20
//Local system is in offline mode.

//INTERNET_CONNECTION_PROXY = 0x04
//Local system uses a proxy server to connect to the Internet.

//INTERNET_RAS_INSTALLED = 0x10
//Local system has RAS installed.
}
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:24 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.