forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Best way to test for a live internet connection using VDS

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
arcray
Valued Contributor
Valued Contributor


Joined: 13 Jul 2001
Posts: 242
Location: Aude, France

PostPosted: Tue Nov 16, 2010 11:23 am    Post subject: Best way to test for a live internet connection using VDS Reply with quote

Can't think straight today!

What is the best way to test if an internet connection is present using VDS 6 and the VDSIPP.DLL, without using PING (it gets blocked a lot)

I was thinking of putting a tiny text file on a web server, and GETting it. If it failed then no connection...

BUT is there a better, quicker way?

Thanks in advance

_________________
Andrew GRAY
If you don't know I am looking for work, I won't get the job.

andrewrcgray.com
Back to top
View user's profile Send private message Send e-mail
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Tue Nov 16, 2010 2:46 pm    Post subject: Reply with quote

You dont have to use vdsipp.dll

On your web server have a file called: test.txt

Contents of test.txt
SERVER CONNECTION OK


Code:

list create,1
list loadfile,1,http://<website address>/location of test.txt
%%result = @text(1)
list close,1

if @equal(%%result,SERVER CONNECTION OK)
info Internet Connection OK
else
warn No Internet Connection
end

VDS6 Can load http files directly into a list ;-)

regards
Nathan


regards
Back to top
View user's profile Send private message Send e-mail Visit poster's website
arcray
Valued Contributor
Valued Contributor


Joined: 13 Jul 2001
Posts: 242
Location: Aude, France

PostPosted: Tue Nov 16, 2010 4:42 pm    Post subject: Reply with quote

Excellent! Just what we needed!

Many Thanks

_________________
Andrew GRAY
If you don't know I am looking for work, I won't get the job.

andrewrcgray.com
Back to top
View user's profile Send private message Send e-mail
arcray
Valued Contributor
Valued Contributor


Joined: 13 Jul 2001
Posts: 242
Location: Aude, France

PostPosted: Tue Nov 16, 2010 5:05 pm    Post subject: Reply with quote

Although it does not work for me. I MUST be doing some thing wrong, but I cannot see what. The first IF @EQUAL does not work, nor the second and obviously the third does.

Code:

  %%Connected =
 
  LIST CREATE,10
  LIST LOADFILE,10,http://gisfiles.co.uk/text.TXT
  %X = @TEXT(10)
  LIST CLOSE,10

  %9 = @INPUT(TheTEXT,%X)
 
  IF @EQUAL(%9,OK)
     %%Connected = 1
  ELSE
    %%Connected =
  END
 
  IF @EQUAL(%X,"OK")
     %%Connected = 1
  ELSE
    %%Connected =
  END
 
  IF @EQUAL(%X,%9)
     %%Connected = 1
  ELSE
    %%Connected =
  END
 
  EXIT
 


But I have no idea what the problem is.

Stumped!

_________________
Andrew GRAY
If you don't know I am looking for work, I won't get the job.

andrewrcgray.com
Back to top
View user's profile Send private message Send e-mail
Claz
Newbie


Joined: 03 Jan 2009
Posts: 23
Location: The Netherlands

PostPosted: Tue Nov 16, 2010 6:38 pm    Post subject: Reply with quote

It seems that you have some artefacts like spaces in %X.
If you use %X = @trim(@TEXT(10)) then spaces are removed and I see only OK, instead of OK with a few tokens.

Hope this will help you.

Claz
Back to top
View user's profile Send private message
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Wed Nov 17, 2010 1:35 pm    Post subject: Reply with quote

How about something like:

Code:

  %%Connected =
 
  LIST CREATE,10
  LIST LOADFILE,10,http://gisfiles.co.uk/text.TXT
 
  IF @match(10,OK)
     %%Connected = 1
  ELSE
    %%Connected =
  END
 
  LIST CLOSE,10
 
  EXIT


Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
arcray
Valued Contributor
Valued Contributor


Joined: 13 Jul 2001
Posts: 242
Location: Aude, France

PostPosted: Wed Nov 17, 2010 2:53 pm    Post subject: Reply with quote

Thanks to All. Claz's suggestion worked and I have now incorporated this solution into my code.

Once again, Thanks

_________________
Andrew GRAY
If you don't know I am looking for work, I won't get the job.

andrewrcgray.com
Back to top
View user's profile Send private message Send e-mail
bornsoft
Contributor
Contributor


Joined: 19 Feb 2009
Posts: 113
Location: Germany

PostPosted: Wed Nov 17, 2010 11:58 pm    Post subject: Reply with quote

Hi,

how about this one:

Code:

  LOADLIB WININET.DLL
   %R = @lib(WININET,InternetCheckConnectionA,bool:,STR:http://www.google.com,INT:1,INT:0)
  FREELIB WININET.DLL
  if %R
      info Connected.
    else
      info Not connected.
  end

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group