mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Patch #401196: Use getaddrinfo and AF_INET6 in TCP servers and clients.
This commit is contained in:
parent
d61e3eab44
commit
a43c2f845e
7 changed files with 160 additions and 49 deletions
|
@ -68,8 +68,10 @@ __all__ = ["HTTPServer", "BaseHTTPRequestHandler"]
|
|||
import sys
|
||||
import time
|
||||
import socket # For gethostbyaddr()
|
||||
import string
|
||||
import mimetools
|
||||
import SocketServer
|
||||
import re
|
||||
|
||||
# Default error message
|
||||
DEFAULT_ERROR_MESSAGE = """\
|
||||
|
@ -474,7 +476,8 @@ def test(HandlerClass = BaseHTTPRequestHandler,
|
|||
|
||||
httpd = ServerClass(server_address, HandlerClass)
|
||||
|
||||
print "Serving HTTP on port", port, "..."
|
||||
sa = httpd.socket.getsockname()
|
||||
print "Serving HTTP on", sa[0], "port", sa[1], "..."
|
||||
httpd.serve_forever()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue