Hi all,
beside #ping: anURL, I can't find a way to detect if the host running the application is connected to the internet. Anybody does? I can't remember now, but I'm pretty sure I was playing arroung, about a year ago, with some method like #hasInternetConnection or #isModemConnection or #isLANConnection Anybody knows it? perhaps some goodie? thanks, -- Sebastián Sastre Seaswork Special Software Solutions www.seaswork.com.ar |
Sebastián,
AFAIK this is the only built-in method of testing connectivity. If this is successfull you'll know that the following works: * Ethernet(ARP)/Modem * Routing (if the url is hosted outside of your network) * DNS (if you use hostnames in your URL) * There is no device blocking http The problem might be to dertermine what exactly you'll need. Depending on this deccision you might want to do your own checks. Some of these checks might require some M$ Network APIs. I think the IP Helper APIs (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iphlp/iphlp/ip_helper_start_page.asp) should do most of the job. 1) Check if local connectivity is available: For Ethernet this means to check whether the NIC has a link. 2) If a default GW is set, ping it (I can send you my ICMP code if you want). If this fails ICMP might be blocked by a FW. Check whether the IP address resolved to an ARP entry. This tells you at least that you can reach the default GW. 3) Check DNS: The class InternetAddress might help you here. If the DNS Servers are in a different subnet you know that DNS and routing works 4) Try to access a resource (e.g. httpd) on a non local subnet host. If this works you're done. Hope this helps. CU, Udo Sebastián Sastre wrote: > Hi all, > > beside #ping: anURL, I can't find a way to detect if the host running > the application is connected to the internet. Anybody does? > > I can't remember now, but I'm pretty sure I was playing arroung, about a > year ago, with some method like #hasInternetConnection or #isModemConnection > or #isLANConnection > > Anybody knows it? perhaps some goodie? > > thanks, > |
In reply to this post by Sebastián Sastre
Sebastián,
> I can't remember now, but I'm pretty sure I was playing arroung, about > a year ago, with some method like #hasInternetConnection or > #isModemConnection or #isLANConnection Could you have been thinking about one of the other WinINetLibrary methods - #internetCheckConnection:.... It's method comment is "Allows an application to check if a connection to the Internet can be established.". I do remember it's use, and that of #internetGoOnline:....., to be somewhat confusing and that they do not always end up with the expected results. -- Ian Use the Reply-To address to contact me. Mail sent to the From address is ignored. |
> Could you have been thinking about one of the other WinINetLibrary
> methods - #internetCheckConnection:.... It's method comment is "Allows an > application to check if a connection to the Internet can be established.". Is what I found in the image now, and in fact it is useful, but I need a more detailed knowledge of the internet connection. I'm sure I was not dreaming when using this two methods that tells you if your host has a lan connection or a modem connection. Perhaps it was a feature of a goodie that I can't find now. regards, -- Sebastián Sastre Seaswork Special Software Solutions www.seaswork.com.ar |
In reply to this post by Udo Schneider
Perhaps I should have to do all that.
It's just before to reinvent wheel I want to query you comunity people for those methods that I saw somewhere. regards -- Sebastián Sastre Seaswork Special Software Solutions www.seaswork.com.ar |
In reply to this post by Sebastián Sastre
Yes! I found it
It was a Steve's one ! Steve Waring made a set of WinInet extensions that are pretty useful. For those interested, the package it's called 'SWWinInetHInternets' and the RootSession has the methods #isOnlie; #isLANConnection; #isModemConnection; #isProxyConnection thank for your job Steve ! -- Sebastián Sastre Seaswork Special Software Solutions www.seaswork.com.ar "Sebastián Sastre" <[hidden email]> escribió en el mensaje news:[hidden email]... >> Could you have been thinking about one of the other WinINetLibrary >> methods - #internetCheckConnection:.... It's method comment is "Allows >> an application to check if a connection to the Internet can be >> established.". > > Is what I found in the image now, and in fact it is useful, but I need a > more detailed knowledge of the internet connection. > I'm sure I was not dreaming when using this two methods that tells you if > your host has a lan connection or a modem connection. Perhaps it was a > feature of a goodie that I can't find now. > > regards, > > -- > Sebastián Sastre > Seaswork > Special Software Solutions > www.seaswork.com.ar > > > > > |
Sebastián Sastre wrote:
> Yes! I found it > > It was a Steve's one ! > > Steve Waring made a set of WinInet extensions that are pretty useful. > For those interested, the package it's called > 'SWWinInetHInternets' and the RootSession has the methods #isOnlie; > #isLANConnection; #isModemConnection; #isProxyConnection > > thank for your job Steve ! > > Hi Sebastián: I can't find this package in Steve site. Where it is? Cheers. gsa. |
Free forum by Nabble | Edit this page |