]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #27392: Document loop.connect_accepted_socket()
authorYury Selivanov <yury@magic.io>
Mon, 7 Nov 2016 20:35:25 +0000 (15:35 -0500)
committerYury Selivanov <yury@magic.io>
Mon, 7 Nov 2016 20:35:25 +0000 (15:35 -0500)
Patch by Jim Fulton.

Doc/library/asyncio-eventloop.rst

index cf2f3d630c863e0c225510017add4398f148aa78..d7201601c59a194ae16562f8e4f14061496e93d3 100644 (file)
@@ -461,6 +461,23 @@ Creating listening connections
 
    Availability: UNIX.
 
+.. coroutinemethod:: BaseEventLoop.connect_accepted_socket(protocol_factory, sock, \*, ssl=None)
+
+   Handle an accepted connection.
+
+   This is used by servers that accept connections outside of
+   asyncio but that use asyncio to handle them.
+
+   Parameters:
+
+   * *sock* is a preexisting socket object returned from an ``accept``
+     call.
+
+   * *ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the
+     accepted connections.
+
+   This method is a :ref:`coroutine <coroutine>`.  When completed, the
+   coroutine returns a ``(transport, protocol)`` pair.
 
 Watch file descriptors
 ----------------------