Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Heisenberg might have been here.


devel / comp.lang.python / Re: Best way to check if there is internet?

SubjectAuthor
o Re: Best way to check if there is internet?Chris Angelico

1
Re: Best way to check if there is internet?

<mailman.29.1644238757.7010.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=16930&group=comp.lang.python#16930

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: Best way to check if there is internet?
Date: Mon, 7 Feb 2022 23:59:04 +1100
Lines: 25
Message-ID: <mailman.29.1644238757.7010.python-list@python.org>
References: <CADrxXXmDuGo7-JmpeEwSpecL9BO-K_umudE7hOCcyC+V78UqJA@mail.gmail.com>
<CAPTjJmog2LaVSqLX=6C2azDw_ngTMKkVaiVPPWBHq9g4DXpcNg@mail.gmail.com>
<CADrxXXkeZmCKGCvCAH4Vcjj2F3-BkkMjUtF=1bo-W0KpGvd2AA@mail.gmail.com>
<4b995eff-0945-b434-5ea9-bf0304965ada@punkt.de>
<CAPTjJmrHywvB1-Fah5HdrP-yHRL3KpUSrKWQ6d4zrAvaeNWK2g@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de mX7GTMWJQcjHZyC6BKT93QGLDvaOUQeWFNNiHP/8XDxw==
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=h8S7Hlpr;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.016
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; '2022': 0.05; 'e.g.': 0.07;
'http': 0.07; 'angelico': 0.09; 'dns': 0.09; 'lookup': 0.09;
'"have': 0.16; '(unless': 0.16; 'cases,': 0.16; 'chrisa': 0.16;
'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
'ping': 0.16; 'sites?': 0.16; 'subject:way': 0.16; 'wrote:': 0.16;
'feb': 0.17; 'probably': 0.17; 'to:addr:python-list': 0.20;
'downloading': 0.22; 'saying': 0.25; 'chris': 0.28; 'request.':
0.28; 'attempt': 0.31; 'subject:there': 0.32; 'message-
id:@mail.gmail.com': 0.32; "i'm": 0.33; 'windows': 0.34; 'header
:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'from:addr:gmail.com': 0.35; 'mon,': 0.36; 'received:209.85':
0.37; 'though': 0.37; 'way': 0.38; 'received:209': 0.39; 'wrote':
0.39; 'exact': 0.40; 'situation': 0.40; 'try': 0.40; 'best': 0.61;
'send': 0.63; 'browser': 0.64; 'about.': 0.64; 'tool': 0.65;
'response.': 0.68; 'subject:check': 0.69; 'care': 0.71;
'surprised': 0.84; 'three,': 0.84; 'differently': 0.91; 'google,':
0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=BH8V1N9YvZU4UMLTqoyaHxp//MaW3Jaw8EKiX4r0Zqk=;
b=h8S7Hlpr36YPL0KAFlDnAKgf+EHjO5+7ua4TwNJXtwCqJ/cSx2gzMXfKP0dLh2EAr6
l2WwMqthwlFxPkv4eEc3X5kb40ORy912gSqtnFi+br30kAL0/R3y/gBxASitzdlpfITv
Zw9l9zh5IIh0QdqABr7asn/xq9HPg8xitm8sSqNwVrzM0JYKGSWEYVM/mBOhAaX444Zr
Ua7evT3Jw4WQD6CXb2/GdNwxjWvM54ZBwxgEP5MeBgtMXR24/IFYHBeJa14PgodrroLm
7L+xTdg8k3n3TES1hFhpoHJONa/LjsNv5Hr6oCW8LuoM/c3ZY2RWEhnlF5eAXiSA9fZF
Mp+w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=BH8V1N9YvZU4UMLTqoyaHxp//MaW3Jaw8EKiX4r0Zqk=;
b=F1gOvjGHh6Srw8eWuMTSBhBvAA3QSKyEymVNFlYPSAxKgoQISisTeSrV/sfR3NPtEx
mrqycNyC3MMUnaKYMcOBH0Fdr/mTfsMVJBRy4Q/NLEU7n+2JxYbRNLRGGIy47L5eER26
yEOZyuUlaBjuT+fdrLTnHWbT4jecj5DLQwQZeRl56MwGeYm/8YYAq9Cz3+hDfE5wEpVo
2kvF/EDnG0p8atXtuJnruS5jdzUUMCysPR2mxBk+uAcDPFwddOtumG0leXleZOXV0Vzv
W4IHsCBqh1xeqO3LySXorT+bK/NNeF0eaquBq090q6kvimxY6aRK60ELi92sueWrDZkH
NJvg==
X-Gm-Message-State: AOAM531rHp5E9uh8thy6lEx9Ktyu2mVZjeqEXMuBHX0TxN6bH+lzKsm0
9xqPptDgCXkoOHFbm3AeW040puZqna69iNKoObJYatZb
X-Google-Smtp-Source: ABdhPJyqkxr0b62aVM/SFxKB/rKlwxazT11b7Vyn5QJSWUs2f+blHBDfVbAZwzREyBdypn/AC9Wz2dQ5ep4dqaZWJkU=
X-Received: by 2002:a5d:4bd2:: with SMTP id l18mr10080956wrt.495.1644238755458;
Mon, 07 Feb 2022 04:59:15 -0800 (PST)
In-Reply-To: <4b995eff-0945-b434-5ea9-bf0304965ada@punkt.de>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPTjJmrHywvB1-Fah5HdrP-yHRL3KpUSrKWQ6d4zrAvaeNWK2g@mail.gmail.com>
X-Mailman-Original-References: <CADrxXXmDuGo7-JmpeEwSpecL9BO-K_umudE7hOCcyC+V78UqJA@mail.gmail.com>
<CAPTjJmog2LaVSqLX=6C2azDw_ngTMKkVaiVPPWBHq9g4DXpcNg@mail.gmail.com>
<CADrxXXkeZmCKGCvCAH4Vcjj2F3-BkkMjUtF=1bo-W0KpGvd2AA@mail.gmail.com>
<4b995eff-0945-b434-5ea9-bf0304965ada@punkt.de>
 by: Chris Angelico - Mon, 7 Feb 2022 12:59 UTC

On Mon, 7 Feb 2022 at 23:48, Lars Liedtke <liedtke@punkt.de> wrote:
>
> Each Browser is doing it differently and even Windows or
> Linux-Desktopmanagers (NetworkManager).
>
> I have had cases, where one tool told me I had Internet and another one
> I hadn't.

Not at all surprised :) Though that situation would probably be best
described as "degraded service". (Unless one tool was straight-up
misconfigured, of course.)

> So What Chris Angelico wrote is propably the best way, ping e.g. Google,
> do a DNS lookup and try http for Status 200. Each with its own
> Errorhandling and if you have got all three, then it is propable that
> you have "Internet".
>

More specifically, what I'm saying is that the best way to determine
whether you "have internet" is to do the exact thing that you care
about. What do you need the internet for? Downloading things from web
sites? Then attempt an HTTP request. Do you need UDP transmission?
Then send a UDP packet somewhere and wait for a response. Etc.

ChrisA

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor