- I'm busy trying to use
socket.getaddrinfo()
to resolve a domain name. When I pass in:
host = 'www.google.com', port = 80, family = socket.AF_INET, type = 0, proto = 0, flags = 0
I get a pair of socket infos like you'd expect, one with SocketKind.SOCK_DGRAM (for UDP) and and the other with SocketKind.SOCK_STREAM (TCP).
When I set proto to
socket.IPPROTO_TCP
I narrow it to only TCP as expected.However, when I use
proto = socket.SOCK_STREAM
(which shouldn't work) I get back a SocketKind.SOCK_RAW.Also, Python won't let me use
proto = socket.IPPROTO_RAW
- I get 'Bad hints'.
Any thoughts on what's going on here?