Skip to content

Commit 41f3c3f

Browse files
committed
Closes #22275: asyncio: enhance documentation of OS support
1 parent e218bcb commit 41f3c3f

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

Doc/library/asyncio-eventloop.rst

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ Creating connections
221221
to bind the socket to locally. The *local_host* and *local_port*
222222
are looked up using getaddrinfo(), similarly to *host* and *port*.
223223

224+
On Windows with :class:`ProactorEventLoop`, SSL/TLS is not supported.
225+
224226
.. seealso::
225227

226228
The :func:`open_connection` function can be used to get a pair of
@@ -239,6 +241,8 @@ Creating connections
239241

240242
See the :meth:`BaseEventLoop.create_connection` method for parameters.
241243

244+
On Windows with :class:`ProactorEventLoop`, this method is not supported.
245+
242246

243247
.. method:: BaseEventLoop.create_unix_connection(protocol_factory, path, \*, ssl=None, sock=None, server_hostname=None)
244248

@@ -251,6 +255,8 @@ Creating connections
251255
establish the connection in the background. When successful, the
252256
coroutine returns a ``(transport, protocol)`` pair.
253257

258+
On Windows with :class:`ProactorEventLoop`, SSL/TLS is not supported.
259+
254260
See the :meth:`BaseEventLoop.create_connection` method for parameters.
255261

256262
Availability: UNIX.
@@ -261,19 +267,19 @@ Creating listening connections
261267

262268
.. 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)
263269

264-
Create a TCP server bound to host and port. Return a :class:`Server` object,
270+
Create a TCP server bound to *host* and *port*. Return a :class:`Server` object,
265271
its :attr:`~Server.sockets` attribute contains created sockets. Use the
266272
:meth:`Server.close` method to stop the server: close listening sockets.
267273

268274
This method is a :ref:`coroutine <coroutine>`.
269275

270-
If *host* is an empty string or None all interfaces are assumed
276+
If *host* is an empty string or ``None``, all interfaces are assumed
271277
and a list of multiple sockets will be returned (most likely
272278
one for IPv4 and another one for IPv6).
273279

274-
*family* can be set to either :data:`~socket.AF_INET` or
280+
*family* can be set to either :data:`socket.AF_INET` or
275281
:data:`~socket.AF_INET6` to force the socket to use IPv4 or IPv6. If not set
276-
it will be determined from host (defaults to :data:`~socket.AF_UNSPEC`).
282+
it will be determined from host (defaults to :data:`socket.AF_UNSPEC`).
277283

278284
*flags* is a bitmask for :meth:`getaddrinfo`.
279285

@@ -283,14 +289,16 @@ Creating listening connections
283289
*backlog* is the maximum number of queued connections passed to
284290
:meth:`~socket.socket.listen` (defaults to 100).
285291

286-
ssl can be set to an :class:`~ssl.SSLContext` to enable SSL over the
292+
*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the
287293
accepted connections.
288294

289295
*reuse_address* tells the kernel to reuse a local socket in
290296
TIME_WAIT state, without waiting for its natural timeout to
291297
expire. If not specified will automatically be set to True on
292298
UNIX.
293299

300+
On Windows with :class:`ProactorEventLoop`, SSL/TLS is not supported.
301+
294302
.. seealso::
295303

296304
The function :func:`start_server` creates a (:class:`StreamReader`,
@@ -308,6 +316,11 @@ Creating listening connections
308316
Watch file descriptors
309317
----------------------
310318

319+
On Windows with :class:`SelectorEventLoop`, only socket handles are supported
320+
(ex: pipe file descriptors are not supported).
321+
322+
On Windows with :class:`ProactorEventLoop`, these methods are not supported.
323+
311324
.. method:: BaseEventLoop.add_reader(fd, callback, \*args)
312325

313326
Start watching the file descriptor for read availability and then call the
@@ -419,6 +432,9 @@ Resolve host name
419432
Connect pipes
420433
-------------
421434

435+
On Windows with :class:`SelectorEventLoop`, these methods are not supported.
436+
Use :class:`ProactorEventLoop` to support pipes on Windows.
437+
422438
.. method:: BaseEventLoop.connect_read_pipe(protocol_factory, pipe)
423439

424440
Register read pipe in eventloop.

Doc/library/asyncio-eventloops.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ asyncio currently provides two implementations of event loops:
3939

4040
Use the most efficient selector available on the platform.
4141

42+
On Windows, only sockets are supported (ex: pipes are not supported):
43+
see the `MSDN documentation of select
44+
<http://msdn.microsoft.com/en-us/library/windows/desktop/ms740141%28v=vs.85%29.aspx>`_.
45+
4246
.. class:: ProactorEventLoop
4347

4448
Proactor event loop for Windows using "I/O Completion Ports" aka IOCP.
@@ -83,9 +87,7 @@ Common limits of Windows event loops:
8387

8488
:class:`SelectorEventLoop` specific limits:
8589

86-
- :class:`~selectors.SelectSelector` is used but it only supports sockets,
87-
see the `MSDN documentation of select
88-
<http://msdn.microsoft.com/en-us/library/windows/desktop/ms740141%28v=vs.85%29.aspx>`_
90+
- :class:`~selectors.SelectSelector` is used but it only supports sockets
8991
- :meth:`~BaseEventLoop.add_reader` and :meth:`~BaseEventLoop.add_writer` only
9092
accept file descriptors of sockets
9193
- Pipes are not supported

0 commit comments

Comments
 (0)