Best way to check if there is internet?

Dennis Lee Bieber wlfraed at ix.netcom.com
Tue Feb 22 23:34:24 EST 2022


On Wed, 23 Feb 2022 07:08:27 +0300, Abdur-Rahmaan Janhangeer
<arj.python at gmail.com> declaimed the following:


>The upcoming operation is short enough and
>though we cannot assume that it will be the case
>when we are running the operation, we sensibly
>assume it will still be the case.
>
>This is more an extra check to not start an operation than
>either relying to check at the start or when query.
>It's both.

	So you have a success/fail tree of...

1	attempt a connection to some IP/port
1a		success -- attempt connection for desired operation
1a1			success -- operation completes
1a2			failure -- report that the operation can not be completed
1b		failure -- report that you will not attempt the operation
				because your test connection to some site failed
				EVEN IF THE OPERATION COULD SUCCEED
				(if the problem is with "some IP/port", not
				the rest of the network)

vs

1	attempt connection for desired operation
1a		success -- operation completes
1b		failure -- report that the operation cannot be completed

	Personally the second tree is simpler -- AND NEEDS TO BE PART OF THE
OTHER TREE ANYWAY! [short tree 1/1a/1b are long tree 1a/1a1/1a2] The only
way the longer tree makes sense is by making step 1 a connection to the
IP/port requested in the desired operation -- and if that succeeds you've
basically performed the shorter tree.

>
>>


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed at ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/


More information about the Python-list mailing list