Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e863739

Browse files
committed
(Merge 3.4) Issue #22063: Fix asyncio documentation of socket and pipe
operations regarding to non-blocking mode. The non-blocking mode does not matter when using a ProactorEventLoop, only for SelectorEventLoop.
2 parents 54c69c2 + d84fd73 commit e863739

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

Doc/library/asyncio-eventloop.rst

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ Low-level socket operations
336336
representing the data received. The maximum amount of data to be received
337337
at once is specified by *nbytes*.
338338

339-
The socket *sock* must be non-blocking.
339+
With :class:`SelectorEventLoop` event loop, the socket *sock* must be
340+
non-blocking.
340341

341342
This method is a :ref:`coroutine <coroutine>`.
342343

@@ -352,7 +353,8 @@ Low-level socket operations
352353
an exception is raised, and there is no way to determine how much data, if
353354
any, was successfully processed by the receiving end of the connection.
354355

355-
The socket *sock* must be non-blocking.
356+
With :class:`SelectorEventLoop` event loop, the socket *sock* must be
357+
non-blocking.
356358

357359
This method is a :ref:`coroutine <coroutine>`.
358360

@@ -370,7 +372,8 @@ Low-level socket operations
370372
:py:data:`~socket.AF_INET` and :py:data:`~socket.AF_INET6` address families.
371373
Use :meth:`getaddrinfo` to resolve the hostname asynchronously.
372374

373-
The socket *sock* must be non-blocking.
375+
With :class:`SelectorEventLoop` event loop, the socket *sock* must be
376+
non-blocking.
374377

375378
This method is a :ref:`coroutine <coroutine>`.
376379

@@ -418,24 +421,30 @@ Connect pipes
418421

419422
.. method:: BaseEventLoop.connect_read_pipe(protocol_factory, pipe)
420423

421-
Register read pipe in eventloop. Set the *pipe* to non-blocking mode.
424+
Register read pipe in eventloop.
422425

423426
*protocol_factory* should instantiate object with :class:`Protocol`
424427
interface. *pipe* is a :term:`file-like object <file object>`.
425428
Return pair ``(transport, protocol)``, where *transport* supports the
426429
:class:`ReadTransport` interface.
427430

431+
With :class:`SelectorEventLoop` event loop, the *pipe* is set to
432+
non-blocking mode.
433+
428434
This method is a :ref:`coroutine <coroutine>`.
429435

430436
.. method:: BaseEventLoop.connect_write_pipe(protocol_factory, pipe)
431437

432438
Register write pipe in eventloop.
433439

434440
*protocol_factory* should instantiate object with :class:`BaseProtocol`
435-
interface. Pipe is file-like object already switched to nonblocking.
441+
interface. *pipe* is file-like object.
436442
Return pair (transport, protocol), where transport support
437443
:class:`WriteTransport` interface.
438444

445+
With :class:`SelectorEventLoop` event loop, the *pipe* is set to
446+
non-blocking mode.
447+
439448
This method is a :ref:`coroutine <coroutine>`.
440449

441450
.. seealso::

0 commit comments

Comments
 (0)