> By attempting to connect you will implicitly query DNS (which itself
> is a connection to server).  

No it's not - it's putting out a packet targeted at an IP address and hoping a 
server will answer - hence why multi-cast works for DNS because you're not 
directly connecting to a specified server, like you do with TCP/IP.  I believe 
it's similar for ping which is why it's used so commonly in monitoring 

> If you're not online you won't be able to
> resolve the domain name.  

Exactly - so if all the OP wanted to check for was a working Internet 
connection, then DNS is a better way to go IMHO.

> Hence no overhead of actually connecting,
> because that won't even start to happen until the hostname is resolved
> to an IP.  If it happens to resolve from some cache, oh well.  Not
> like its that much overhead.  You're nitpicking over the number of
> packets it takes to SYN/ACK.

Yep and if it's running inside a LAN with x number of computers all doing the 
same thing, that mounts up to a lot of unnecessary traffic - I've seen it.

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to