From: James Carlson <carlsonj@workingcode.com>
To: linux-ppp@vger.kernel.org
Subject: Re: Socket doesn't get EOF
Date: Thu, 18 Nov 2004 12:04:29 +0000 [thread overview]
Message-ID: <16796.36813.379818.814193@carlson.workingcode.com> (raw)
In-Reply-To: <41998875.2020305@blazemail.com>
K-sPecial writes:
> Well, yes and no. In the way of the bot, not drasticly. Although the
> other day I was programming some perl that needed to know when the
> computer was online and when it wasn't. I realy didn't give it as much
> thought as I could have, but resorted to the resolution of a popular
> name server, such as internic.net. This of course can also have problems
>
> when your DNS server(s) happens to not cooperate. Honestly i'm sure this
> isn't the correct manor to go about such a thing, but for what I needed
> it for, it should suffice. I was going to test for interfaces being up,
> which would work in the case of pppd, just not in the case of say DSL
> where your interface can obviously still be up yet your modem isn't online.
SIOCGIFCONF can tell you if you have interfaces available.
Even if the interfaces are up and the modem is "on line," that doesn't
mean that any particular host is actually reachable. That sort of
global knowledge just isn't knowable, except in retrospect: if the
connection times out, then that host obviously can't be reached.
> But as to your question, I would say there is, when you just need to
> know, period, if you can successfuly access a remote node via the
> Internet, and don't actualy need the support of an exact cause.
That's what timeouts are for. You can use the existing default
timeout provided by TCP, or (if that's too long) you can set up your
own timer with alarm() or similar functions.
--
James Carlson <carlsonj@workingcode.com>
next prev parent reply other threads:[~2004-11-18 12:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-16 4:56 Socket doesn't get EOF K-sPecial
2004-11-16 20:49 ` carlsonj
2004-11-16 22:59 ` K-sPecial
2004-11-17 11:43 ` carlsonj
2004-11-17 23:41 ` K-sPecial
2004-11-18 12:04 ` James Carlson [this message]
2004-11-18 18:06 ` K-sPecial
2004-11-18 18:30 ` James Carlson
2004-11-18 18:54 ` K-sPecial
2004-11-18 19:29 ` James Carlson
2004-11-18 21:07 ` K-sPecial
2004-11-18 21:11 ` K-sPecial
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16796.36813.379818.814193@carlson.workingcode.com \
--to=carlsonj@workingcode.com \
--cc=linux-ppp@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).