summaryrefslogtreecommitdiff
path: root/examples/network/https_client_nonblocking.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network/https_client_nonblocking.py')
-rw-r--r--examples/network/https_client_nonblocking.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/network/https_client_nonblocking.py b/examples/network/https_client_nonblocking.py
index 6e6b7f37b..41447e81e 100644
--- a/examples/network/https_client_nonblocking.py
+++ b/examples/network/https_client_nonblocking.py
@@ -37,13 +37,13 @@ def read_nonblocking(poller, sock, n):
return data
-def main(url):
+def main(url, addr_family=0):
# Split the given URL into components.
proto, _, host, path = url.split(b"/", 3)
assert proto == b"https:"
# Note: this getaddrinfo() call is blocking!
- ai = socket.getaddrinfo(host, 443)[0]
+ ai = socket.getaddrinfo(host, 443, addr_family, socket.SOCK_STREAM)[0]
addr = ai[-1]
print("Connect address:", addr)