Re: PPP notifier
Re: PPP notifier
- Subject: Re: PPP notifier
- From: Chris Hanson <email@hidden>
- Date: Wed, 20 Mar 2002 19:42:02 -0600
At 4:35 PM +0100 3/20/02, Jirome Foucher wrote:
Am I doing something wrong ? Or is it wanted ? What's the right way to do it ?
I don't think you're doing anything wrong, it's just that the Open
Transport PPP API on Mac OS X isn't really complete.
You can get more details about the status of a PPP connection with
two option management calls. You can get connection status by
examining the connectionStatus field of a CCMiscInfo structure
retrieved using COM_PPP/CC_OPT_GETMISCINFO, and you can get the PPP
state using COM_PPP/PPP_OPT_GETCURRENTSTATE.
Possible PPP states are initial, closed, closing, opening, and
opened. Possible connection statuses are idle, connecting,
connected, and disconnecting.
The down side is that you have to build a state machine and poll
these for transitions you're interested in, rather than wait for a
notification. Fortunately if you can figure out PPP option
management (thanks, Quinn!) it's easy to get them and figure out
which states and statuses mean what.
One other problem with OT/PPP on Mac OS X is that you have no control
(that I can find) over the human interface. Thus if PPP can't
connect to a server, Internet Connect puts up an alert, and you never
actually see any error in your code. Instead, you have to notice
that the state/status transitioned from opening/connecting to
closing/disconnecting, and do the right thing in your code. Of
course, you can't say *why* you weren't able to connect even though
Internet Connect obviously has this information. Internet Connect
will also keep your application in the foreground, but won't bring
any of your application's interface to the front when you dismiss the
alert it puts up...
-- Chris
--
Chris Hanson | Email: email@hidden
bDistributed.com, Inc. | Phone: +1-847-372-3955
Mac OS X & WebObjects Consulting | Fax: +1-847-589-3738
http://bdistributed.com/ | Personal Email: email@hidden
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.
References: | |
| >PPP notifier (From: Jérome Foucher <email@hidden>) |