summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2014-05-17 22:56:53 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2014-05-17 22:56:53 (GMT)
commitf48ff0dd6cacf26e72e2fc5b3c2d07dc6d8a43af (patch)
treed01f329118f1040eb9346c7fa356cf6ab036cc91 /Doc/library
parentbcaf5999e6333c25778b0d4039fa5ee8c3e97035 (diff)
parent75e03388d8e8d80613eaffb560c7d44f3c313738 (diff)
downloadcpython-f48ff0dd6cacf26e72e2fc5b3c2d07dc6d8a43af.zip
cpython-f48ff0dd6cacf26e72e2fc5b3c2d07dc6d8a43af.tar.gz
cpython-f48ff0dd6cacf26e72e2fc5b3c2d07dc6d8a43af.tar.bz2
Issue #21430: additions to the description of non-blocking SSL sockets
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/ssl.rst8
1 files changed, 7 insertions, 1 deletions
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
index 8c1484b..f8bdcb0 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -1631,8 +1631,14 @@ thus several things you need to be aware of:
and :meth:`SSLSocket.send` failures, and retry after another call to
:func:`~select.select`.
+- Conversely, since the SSL layer has its own framing, a SSL socket may
+ still have data available for reading without :func:`~select.select`
+ being aware of it. Therefore, you should first call
+ :meth:`SSLSocket.recv` to drain any potentially available data, and then
+ only block on a :func:`~select.select` call if still necessary.
+
(of course, similar provisions apply when using other primitives such as
- :func:`~select.poll`)
+ :func:`~select.poll`, or those in the :mod:`selectors` module)
- The SSL handshake itself will be non-blocking: the
:meth:`SSLSocket.do_handshake` method has to be retried until it returns