]> granicus.if.org Git - python/commitdiff
asyncio doc: reformat create_server() doc
authorVictor Stinner <victor.stinner@gmail.com>
Sun, 12 Oct 2014 18:36:04 +0000 (20:36 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Sun, 12 Oct 2014 18:36:04 +0000 (20:36 +0200)
Fix also the reate_unix_connection() doc: the method is not support on Windows,
not need to mention that ssl is not support with ProactorEventLoop.

Doc/library/asyncio-eventloop.rst
Doc/library/asyncio-eventloops.rst

index 5ffbea741285b777252b1690a7efb619ae4acc70..800fae236f11fadac44925315d6ec1f05c2dda68 100644 (file)
@@ -258,8 +258,6 @@ Creating connections
    establish the connection in the background.  When successful, the
    coroutine returns a ``(transport, protocol)`` pair.
 
-   On Windows with :class:`ProactorEventLoop`, SSL/TLS is not supported.
-
    See the :meth:`BaseEventLoop.create_connection` method for parameters.
 
    Availability: UNIX.
@@ -270,35 +268,41 @@ Creating listening connections
 
 .. method:: BaseEventLoop.create_server(protocol_factory, host=None, port=None, \*, family=socket.AF_UNSPEC, flags=socket.AI_PASSIVE, sock=None, backlog=100, ssl=None, reuse_address=None)
 
-   Create a TCP server bound to *host* and *port*. Return a :class:`Server` object,
-   its :attr:`~Server.sockets` attribute contains created sockets. Use the
-   :meth:`Server.close` method to stop the server: close listening sockets.
+   Create a TCP server (socket type :data:`~socket.SOCK_STREAM`) bound to
+   *host* and *port*.
 
-   This method is a :ref:`coroutine <coroutine>`.
+   Return a :class:`Server` object, its :attr:`~Server.sockets` attribute
+   contains created sockets. Use the :meth:`Server.close` method to stop the
+   server: close listening sockets.
 
-   If *host* is an empty string or ``None``, all interfaces are assumed
-   and a list of multiple sockets will be returned (most likely
-   one for IPv4 and another one for IPv6).
+   Parameters:
 
-   *family* can be set to either :data:`socket.AF_INET` or
-   :data:`~socket.AF_INET6` to force the socket to use IPv4 or IPv6. If not set
-   it will be determined from host (defaults to :data:`socket.AF_UNSPEC`).
+   * If *host* is an empty string or ``None``, all interfaces are assumed
+     and a list of multiple sockets will be returned (most likely
+     one for IPv4 and another one for IPv6).
 
-   *flags* is a bitmask for :meth:`getaddrinfo`.
+   * *family* can be set to either :data:`socket.AF_INET` or
+     :data:`~socket.AF_INET6` to force the socket to use IPv4 or IPv6. If not set
+     it will be determined from host (defaults to :data:`socket.AF_UNSPEC`).
 
-   *sock* can optionally be specified in order to use a preexisting
-   socket object.
+   * *flags* is a bitmask for :meth:`getaddrinfo`.
 
-   *backlog* is the maximum number of queued connections passed to
-   :meth:`~socket.socket.listen` (defaults to 100).
+   * *sock* can optionally be specified in order to use a preexisting
+     socket object. If specified, *host* and *port* should be omitted (must be
+     :const:`None`).
 
-   *ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the
-   accepted connections.
+   * *backlog* is the maximum number of queued connections passed to
+     :meth:`~socket.socket.listen` (defaults to 100).
 
-   *reuse_address* tells the kernel to reuse a local socket in
-   TIME_WAIT state, without waiting for its natural timeout to
-   expire. If not specified will automatically be set to True on
-   UNIX.
+   * *ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the
+     accepted connections.
+
+   * *reuse_address* tells the kernel to reuse a local socket in
+     TIME_WAIT state, without waiting for its natural timeout to
+     expire. If not specified will automatically be set to True on
+     UNIX.
+
+   This method is a :ref:`coroutine <coroutine>`.
 
    On Windows with :class:`ProactorEventLoop`, SSL/TLS is not supported.
 
@@ -462,7 +466,7 @@ Use :class:`ProactorEventLoop` to support pipes on Windows.
 
    *protocol_factory* should instantiate object with :class:`BaseProtocol`
    interface. *pipe* is file-like object.
-   Return pair (transport, protocol), where transport support
+   Return pair (transport, protocol), where *transport* supports
    :class:`WriteTransport` interface.
 
    With :class:`SelectorEventLoop` event loop, the *pipe* is set to
index 282cc4b365f91c97ffc8550c51582c2a3e0680ff..b8710830f220149eaae7b65c4ab57d033629de8f 100644 (file)
@@ -76,7 +76,7 @@ Windows
 
 Common limits of Windows event loops:
 
-- :meth:`~BaseEventLoop.create_unix_server` and
+- :meth:`~BaseEventLoop.create_unix_connection` and
   :meth:`~BaseEventLoop.create_unix_server` are not supported: the socket
   family :data:`socket.AF_UNIX` is specific to UNIX
 - :meth:`~BaseEventLoop.add_signal_handler` and