I know I've seen this floating around years ago, but since it wasn't
important then, I didn't "notice" it. Now, I think I'm in a situation
where I need it, and I can't find it. Maybe somebody here can clue me in.
I need to figure out, within a program, whether Remote
Access/OpenTransport is currently conected to the 'net, preferably
without triggering a connection if it isn't already up. Over the years,
I've noticed that Remote Access (or at least, I'm *GUESSING* it's Remote
Access...) puts up a nasty modal box that grinds the rest of the machine
to a halt if the Remote Access control panel/app isn't open and
something tries to make traffic on the 'net when the connection is down.
This can be ugly, as anyone who has encountered it is well aware.
I'd prefer to avoid that, if possible, while also avoiding blocking my
program until the connection comes up. What I have in mind is a loop
like so, sitting off in a separate thread from the main program thread:
ResultType PhoneHome(DataToSend *MessagePacket)
{
ResultType Result;
boolean Connected = false; /* Assume we aren't until further notice */
while (!Connected)
{
GoDoOtherThings(); /* Might YieldToAnyThread() */
YieldToAnyThread(); /* Guarantee one yield per loop */
Connected = AreWeConnectedToTheInternet();
}
/* If we're here, the connection is open. Lets do our thing. */
Result = SendPacketToServer(MessagePacket);
return Result;
}
Anybody got anything (or know where I should look for the "recipe") that
would serve for "AreWeConnectedToTheInternet()"?

Signature
Don Bruder - dakidd@sonic.net <--- Preferred Email - SpamAssassinated.
Hate SPAM? See <http://www.spamassassin.org> for some seriously great info.
I will choose a path that's clear: I will choose Free Will! - N. Peart
Fly trap info pages: <http://www.sonic.net/~dakidd/Horses/FlyTrap/index.html>
Miro Jurisic - 26 Dec 2003 20:32 GMT
> I know I've seen this floating around years ago, but since it wasn't
> important then, I didn't "notice" it. Now, I think I'm in a situation
[quoted text clipped - 3 lines]
> Access/OpenTransport is currently conected to the 'net, preferably
> without triggering a connection if it isn't already up.
<http://developer.apple.com/technotes/tn/tn1145.html>
hth
meeroh

Signature
If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>
Don Bruder - 26 Dec 2003 21:31 GMT
> > I know I've seen this floating around years ago, but since it wasn't
> > important then, I didn't "notice" it. Now, I think I'm in a situation
[quoted text clipped - 7 lines]
>
> hth
Indeed it does. Thank you, my good man! :)

Signature
Don Bruder - dakidd@sonic.net <--- Preferred Email - SpamAssassinated.
Hate SPAM? See <http://www.spamassassin.org> for some seriously great info.
I will choose a path that's clear: I will choose Free Will! - N. Peart
Fly trap info pages: <http://www.sonic.net/~dakidd/Horses/FlyTrap/index.html>