Re: Ethernet Cable Status Detection
Re: Ethernet Cable Status Detection
- Subject: Re: Ethernet Cable Status Detection
- From: Chris Hanson <email@hidden>
- Date: Sun, 15 Apr 2007 17:34:33 -0700
On Apr 12, 2007, at 8:04 AM, sunil prajapati wrote:
I have written a client - server program using BSD socket in carbon.
Now I want to show an alert if ethernet cable is plugged out. I want
to continuosly scan the ethernet port on a thread so that if
ethernet cable plugged out client application will show an alert
that ethernet cable is plugged out.
It sounds like what you really want to do is alert the user of the
client program when the server is unreachable. Macs have supported
built-in wireless networking for 8 years, supported infrared
communications well before then, and have even more communications
options now with FireWire, BlueTooth, and so on. In fact, the Mac Pro
has two onboard 1000Base-T Ethernet ports; will you require your users
to communicate with the server over a particular port?
You should just handle normal network errors in your application and
use the System Configuration framework's "reachability" support to
determine whether a particular host you want to communicate with can
be reached. Unless you have very special circumstances, don't bother
trying to detect the state of particular network connections, don't
bother trying to figure out whether the user is "connected to the
Internet" (whatever that means; it can mean very different things at
different companies, in different countries, in hotels, over VPNs,
etc.), or any other such generic situations.
Instead, just check to see whether the user can perform the particular
operation that your software needs and only that, and don't worry
about the particulars.
-- Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden