linux-ppp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Carlson <carlsonj@workingcode.com>
To: linux-ppp@vger.kernel.org
Subject: Re: Socket doesn't get EOF
Date: Thu, 18 Nov 2004 18:30:59 +0000	[thread overview]
Message-ID: <16796.60003.33064.977311@carlson.workingcode.com> (raw)
In-Reply-To: <41998875.2020305@blazemail.com>

K-sPecial writes:
> > 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.
> 
> Well there the problem lies within, the script was meant to to check if 
> a port was open every so often, if it's down, check if your online, then 
> possibly wait again to see if it opens back up, say 10 minutes (maybe 
> the computer rebooted, maybe crontab will restart it), check again if 
> online, then point the hostname to a different ip and start checking if 
> the old host is back up again (so I can change it back). So just 
> checking if I could access the host is what I was *double* checking, of 
> course I couldn't rely on just the fact that I can't reach the port, 
> before updating it to a new ip.

What's the point?

If the system is isolated from the world, then periodically noticing
that the 'port' still isn't reachable, and switching to a different IP
address should make no difference at all.

Why condition the logic on local interface status?

>  > 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.
> 
> Yup, i'm not sure but it seems the timeout optino that IO::Socket uses 
> is just a connect timeout, it didn't seem to register when pppd died, 
> could be wrong.

Again, that's not a bug.  It's a design feature of TCP/IP.  Links
going up and down intentionally do _not_ cause connections to fail.

If you care about particular interfaces for some reason, then use
SIOCGIFCONF to read the kernel's interface table or open a routing
socket (PF_ROUTE) and listen for interface add/delete messages.

-- 
James Carlson                                 <carlsonj@workingcode.com>

  parent reply	other threads:[~2004-11-18 18:30 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
2004-11-18 18:06 ` K-sPecial
2004-11-18 18:30 ` James Carlson [this message]
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.60003.33064.977311@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).