example/http_client.py: Remove unused code.
This commit is contained in:
parent
cf4b72bf13
commit
cef073877b
|
@ -6,19 +6,9 @@ except:
|
|||
|
||||
s = _socket.socket()
|
||||
|
||||
if 1:
|
||||
ai = _socket.getaddrinfo("google.com", 80)
|
||||
print("Address infos:", ai)
|
||||
addr = ai[0][4]
|
||||
else:
|
||||
# Deprecated ways to construct connection address
|
||||
addr = _socket.sockaddr_in()
|
||||
addr.sin_family = 2
|
||||
#addr.sin_addr = (0x0100 << 16) + 0x007f
|
||||
#addr.sin_addr = (0x7f00 << 16) + 0x0001
|
||||
#addr.sin_addr = _socket.inet_aton("127.0.0.1")
|
||||
addr.sin_addr = _socket.gethostbyname("google.com")
|
||||
addr.sin_port = _socket.htons(80)
|
||||
ai = _socket.getaddrinfo("google.com", 80)
|
||||
print("Address infos:", ai)
|
||||
addr = ai[0][4]
|
||||
|
||||
print("Connect address:", addr)
|
||||
s.connect(addr)
|
||||
|
|
Loading…
Reference in New Issue