Craig A. Finseth wrote:
Just out of curiosity, what exactly are you looking to do that you don't
want to make a connection attempt? Also, are you more concerned about
trying to transmit at all, or rather the overhead of a tcp connection?
The idea is to find out whether a network connection would work
without actually doing it. (If it could be made to work, which it
can't,) this would be a good feature to add to any network client
program.
For example, it would be nice to know that the system is all set and
ready to go to use, say, a phone dialup, but you don't want to take
the time to make a call at this point in the process. However, if you
if you knew it would fail, tell the user before they do a bunch of stuff.
Craig
Ok, I followed you pretty well then. With a LAN style connection, I
think checking to see if a NIC is listed, via the networkinterface
class, and then check the ip addresses of any interfaces present. Sure
fire? No, but if you can check for invalid ip addresses, such as one
with a 169 prefix, then you're a big step towards knowing what the link
status is. I see Stefan mentioned parsing ifconfig, but that isn't
required unless you're interested in the gateway address. You can also
look at system.network.isconnected.
As for dial up... hmmm. I haven't done much with modems in RB, or any
other programming language for that matter. I assume there are ways to
check the system for a modem, then you could certainly use the serial
interface to query the modem. I recall from my ISP support days that
running atdt to the modem will cause it to pick up, which would
presumably allow one to assess the dial-tone situation, then pass atz to
reset it. Please, by all that's holy, double check these thing. Thanks
to the glorious years of 1996 and 1997, my memory is held together with
bong resin, and I'd hate to see you accidentally store some bizarre
string in your modem's memory register. Anyway, if you establish that a
modem exists, and that a dialtone is present, then you just need to
check that tcp is installed and you're as close to knowing for sure as
possible.
Good luck,
Fargo
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>