Alexandre Julliard wrote:
> Aric Stewart <[EMAIL PROTECTED]> writes:
>
> > However the API seems to lend itself to not only checking a generic
> > internet connection but also checking conductivity to a specific host.
> > For this a ping sort of approach seems appropriate. I will work at
> > taking out the www.ibm.net for a null parameter and instead using
> > netstat -r -n.
>
> Having to parse the output of netstat will be more trouble than it's
> worth IMO. I think we should not try to be too clever here. I'd
> suggest simply checking for a network interface that is up and not
> loopback, using the same ioctls than ifconfig does.
>
True, but you don't have to parse the output if you just use pipe it through
grep "^default" and test the return value, which was the point of my message
in the first place. It also seems that this little netstat -r -n | grep
"^default" works on all unices.
You are right though, it's still a half-assed way of doing it. The
advantage is that it should work on all unices and we won't need different
code for different ioctl's on different unices.
-Dave