{"id":4991,"date":"2025-12-17T21:29:50","date_gmt":"2025-12-17T21:29:50","guid":{"rendered":"https:\/\/ibex.tech\/python\/?p=4991"},"modified":"2025-12-17T21:29:50","modified_gmt":"2025-12-17T21:29:50","slug":"is-internet-reachable","status":"publish","type":"post","link":"https:\/\/ibex.tech\/python\/tcp-ip\/is-internet-reachable","title":{"rendered":"Is internet reachable"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>import socket\n\n#*******************************************\n#*******************************************\n#********** IS INTERNET REACHABLE **********\n#*******************************************\n#*******************************************\ndef is_internet_reachable(timeout=3):        #timeout in seconds\n    try:\n        socket.create_connection((\"8.8.8.8\", 53), timeout=timeout)\n        return True\n    except OSError:\n        return False<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[359],"tags":[],"class_list":["post-4991","post","type-post","status-publish","format-standard","hentry","category-tcp-ip"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4991","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/comments?post=4991"}],"version-history":[{"count":1,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4991\/revisions"}],"predecessor-version":[{"id":4992,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4991\/revisions\/4992"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/media?parent=4991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/categories?post=4991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/tags?post=4991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}