Re: Distinguishing between ppp and ethernet
Re: Distinguishing between ppp and ethernet
- Subject: Re: Distinguishing between ppp and ethernet
- From: Quinn <email@hidden>
- Date: Fri, 31 May 2002 13:57:04 +0100
Thanks for the background. It really helps.
At 10:05 +1200 29/5/02, Andrew wrote:
Also, there is currently no way of determining whether a connection
will cause a dialup using rb sockets...they have a pppstatus but
obviously its value is only relevant if the user is actually using a
ppp interface....and there is no way of determining this without
initiating a connection and seeing whether the pppstatus changes.
OK, this is really easy. System Configuration framework provides two
high-level APIS, SCNetworkCheckReachabilityByAddress and
SCNetworkCheckReachabilityByName, that will tell you if connecting to
a specific address is likely to trigger a dial.
Im using REALbasic to create an application that downloads various
files using the http protocol, unfortunately REALbasic has a problem
on both windows and osx where if a connection using ppp is
unexpectedly interrupted, either by the remote server or by pulling
the plug, the realbasic sockets begin returning a stupidly high
number as their error code, and continue to do this even once the
user is reconnected....although on osx ignoring the error will allow
the new connection to be used, so long as there is one.
So what I need to do is work around it, I cannot assume that this
error will only be returned in that situation (although that may be
the case) so I want to nail down some details about what type of
interface is being used, whether or not there is actually a valid
connection, and react to the stupidly high error code appropriately.
(any wild guesses about what they are doing wrong that may be
causing this?)
My guess is that they're suffering from stale source addresses. In
traditional Mac OS when the PPP connection goes down OT tears down
all of the TCP/IP endpoints. However, this doesn't happen on Mac OS
X. If the endpoint is bound to a specific source address (typically
this happens when you connect) and the interface goes down, taking
with it that source address, the endpoint becomes useless. Even if
you reconnect the endpoint is still useless unless the PPP server
happens to hand you back the original source address.
The solution to this is to use the SCF dynamic store to monitor the
IP address list and, when the list changes, make sure that the source
addresses for all of your endpoints are still valid. I have plans to
write a sample that shows how to do this (part of a general update to
Technote 1145) but it's not done yet.
S+E
--
Quinn "The Eskimo!" <
http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
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.