iwdu15 said:
yea...i saw alot of things on that after doing a google search....i was
wondering, would connecting a socket to the same computer then checking
the
remote end point work? i just want to avoid using any websites incase they
are unavailable for some reason....
Do you mean connecting to "yourself"? I don't think so, as it would be
clever enough to realise that it is within the local segment... the gateway
(and beyond) is only accessed when the computer doesn't "know" how to get to
the destination you give it - so anything on the same subnet will connect
"directly" (for want of a better phrase), whereas anything else will go to
the gateway...
Now, I guess you could try pinging a completely random address and not worry
if it's there or not, and see if the reply (from the gateway and whatever
it's gateway is) gives any information as to the external address? I'm not
sure it will, but perhaps worth a go - effectively you need to work out how
to do a traceroute... then it shouldn't matter if the remote site is up or
down.
I don't have code for doing that however, but a google may turn up
something...
James.