Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-24-2005, 01:02 AM
Junior Member
 
Join Date: Jan 2005
Posts: 15
Default constant internet connection

Hi, I need my application to constantly verify that it internet connection is available. What is the best way to do this?

thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 01-25-2005, 10:56 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:constant internet connection

Because you need to check the internet connection state constantly, the ping method is not so good as you have mentioned in another topic.

We will build a dll for you, it will check the state of the internet connection in a work thread so the application won't freeze.
Reply With Quote
  #3 (permalink)  
Old 01-25-2005, 12:18 PM
Member
 
Join Date: May 2003
Posts: 35
Default Re:constant internet connection

Hi,

Could you make that DLL available to everyone?

Thankx.
Reply With Quote
  #4 (permalink)  
Old 01-25-2005, 03:37 PM
Junior Member
 
Join Date: Jan 2005
Posts: 15
Default Re:constant internet connection

that would be awesome, Thank you very much for your help.
Reply With Quote
  #5 (permalink)  
Old 01-27-2005, 04:06 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:constant internet connection

Please extract the attached file and add the inetconn.dll into the attachment list in swfkit pro.

Code:
var dll = getAdditionalFile("inetconn.dll");
Dll.registerFunction(dll, "start", "start", "cdecl", "void", "char*");
Dll.registerFunction(dll, "stop", "stop", "cdecl", "void");
Dll.registerFunction(dll, "GetInternetConnectedState", "getInternetConnectedState", 
***"cdecl", "long");
***
function showState()
{
***var state = getInternetConnectedState();
***trace("The internet connection state: ", 
******state == 0 ? "unknown" : (state == 1 ? "offline" : "online"));
}

Application.setInterval(showState, 1000);
start("www.swfkit.com");


getMainWnd().onClose = function ()
{
***stop();
}
Reply With Quote
  #6 (permalink)  
Old 01-27-2005, 04:15 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:constant internet connection

The inetconn.dll exports three functions:

1. function start(server)
server is the address of a remote host on internet. This function starts a thread to ping the server every other minute.

2. function stop()
This function stops the pinging thread. It must be called before the application is about to close.

3. function GetInternetConnectedState()
This function returns the pinging result. 0 indicates that it's still pinging and the internet connected state is unknown, 1 indicates that it's offline and 2 indicates that it's online.
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 07:37 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.