Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
httplib and socket.getaddrinfo
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="mirandacascade, post: 2051085"] I noticed the following lines from the connect() method of the HTTPConnection class within httplib: for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res This led me to the docs that describe the socket.getaddrinfo() method: [URL]http://www.python.org/doc/2.4.1/lib/module-socket.html[/URL] Which leads me to these questions: 1) Is it correct to infer from the "Resolves the host/port argument, into a sequence of 5-tuples that contain all the necessary argument for the sockets manipulation" description in the docs (in particular the reference to 'sequence of 5-tuples') that a single host/port combination may be associated with multiple sets of address information? 2) In the very limited applications on which I've used socket.getaddrinfo(), each a host/port combination that my application passes to socket.getaddrinfo() has always returned a 1-entry list where the list is a 5-tuple, in other words, each host/port combination has always been associated with one set of address information. Can someone point me to a host/port combination that, when passed to socket.getaddrinfo() will result in socket.getaddrinfo() returning a list of > 1 entry, where each entry is a 5-tuple? Thank you. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
httplib and socket.getaddrinfo
Top