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

Skip to content

Commit f48ff0d

Browse files
committed
Issue #21430: additions to the description of non-blocking SSL sockets
2 parents bcaf599 + 75e0338 commit f48ff0d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Doc/library/ssl.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1631,8 +1631,14 @@ thus several things you need to be aware of:
16311631
and :meth:`SSLSocket.send` failures, and retry after another call to
16321632
:func:`~select.select`.
16331633

1634+
- Conversely, since the SSL layer has its own framing, a SSL socket may
1635+
still have data available for reading without :func:`~select.select`
1636+
being aware of it. Therefore, you should first call
1637+
:meth:`SSLSocket.recv` to drain any potentially available data, and then
1638+
only block on a :func:`~select.select` call if still necessary.
1639+
16341640
(of course, similar provisions apply when using other primitives such as
1635-
:func:`~select.poll`)
1641+
:func:`~select.poll`, or those in the :mod:`selectors` module)
16361642

16371643
- The SSL handshake itself will be non-blocking: the
16381644
:meth:`SSLSocket.do_handshake` method has to be retried until it returns

0 commit comments

Comments
 (0)