NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Alberto on May 28, 2014, 07:27:35 AM
-
Hi,
I need to test if the server has internet connection.
How can I do it?
Thanks
-
lots of ways - depending on how you define "the internet".
One option is just to ping www.google.com.
Personally I prefer to just "do what you need to do". If you get an error then deal with the error.
cheers
Bruce
-
It is a complex problem.
My client has a non stable internet connection with a telephonic ISP
They need to know when the server lost this connection because theyre own clients complains about it
They has an internal smtp and my idea is to check for the internet conn and send them an internal mail.
How would you do this?
Thanks
-
I'd just ping google.
NetDemo has an example of doing a ping - it's in one of the menu items as I recall.
cheers
Bruce
-
Hi Michelis,
I found this by accident and if you have File Explorer than it will work for you
fe_OnlineStatus
fe_OnlineStatus ( byte pOption=0 ) ,byte
Description
This function's purpose is to establish whether you are currently connected to the internet. The behaviour / result of the function is determined by the parameter pOption.
If pOption is omitted (or passed as zero), this function will simply return true (1) or false (0), indicating whether you are connected or not.
if fe_OnlineStatus() = 1
message ('I am connected!')
end
If pOption is passed as 1, 2, 3 or 4, this function returns the following:
pOption=1; returns true / false indicating whether the local system is in offline mode
pOption=2; returns true / false indicating whether the local system uses a modem to connect to the internet
pOption=3; returns true / false indicating whether the local system uses a local network area to connect to the internet
pOption=4; returns true / false indicating whether the local system uses a proxy server to connect to the internet
if fe_OnlineStatus(4) = true
message('You are connected through a Proxy Server')
end
If the function returns a negative number it indicates that an error occurred.
Best regards,
Djordje Radovanovic
-
Hi,
Another way would be to do it from outside in.
Check uptimerobot.com,
it will monitor your server and keep a log, and notify you if the server is down.
Johan