diff options
author | Giampaolo RodolĂ <g.rodola@gmail.com> | 2011-02-25 22:21:22 (GMT) |
---|---|---|
committer | Giampaolo RodolĂ <g.rodola@gmail.com> | 2011-02-25 22:21:22 (GMT) |
commit | 103a6d6cd6eb5bf894890f0126547e64ff20a5c9 (patch) | |
tree | f563f4acf086ebf336d7d0319ee0070f5bc92770 /Doc/library/asyncore.rst | |
parent | 0bd4deba383b1c7f05a4e0c94f1d4b96050a1308 (diff) | |
download | cpython-103a6d6cd6eb5bf894890f0126547e64ff20a5c9.zip cpython-103a6d6cd6eb5bf894890f0126547e64ff20a5c9.tar.gz cpython-103a6d6cd6eb5bf894890f0126547e64ff20a5c9.tar.bz2 |
Issue 11177: asyncore's create_socket() arguments can now be omitted.
Diffstat (limited to 'Doc/library/asyncore.rst')
-rw-r--r-- | Doc/library/asyncore.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst index 54dd249..aa16aca 100644 --- a/Doc/library/asyncore.rst +++ b/Doc/library/asyncore.rst @@ -184,12 +184,14 @@ any that have been added to the map during asynchronous service) is closed. Most of these are nearly identical to their socket partners. - .. method:: create_socket(family, type) + .. method:: create_socket(family=socket.AF_INET, type=socket.SOCK_STREAM) This is identical to the creation of a normal socket, and will use the same options for creation. Refer to the :mod:`socket` documentation for information on creating sockets. + .. versionchanged:: 3.3 family and type arguments can be omitted. + .. method:: connect(address) @@ -280,7 +282,7 @@ implement its socket handling:: def __init__(self, host, path): asyncore.dispatcher.__init__(self) - self.create_socket(socket.AF_INET, socket.SOCK_STREAM) + self.create_socket() self.connect( (host, 80) ) self.buffer = bytes('GET %s HTTP/1.0\r\n\r\n' % path, 'ascii') @@ -326,7 +328,7 @@ connections and dispatches the incoming connections to a handler:: def __init__(self, host, port): asyncore.dispatcher.__init__(self) - self.create_socket(socket.AF_INET, socket.SOCK_STREAM) + self.create_socket() self.set_reuse_addr() self.bind((host, port)) self.listen(5) |