Kaydet (Commit) f48ff0dd authored tarafından Antoine Pitrou's avatar Antoine Pitrou

Issue #21430: additions to the description of non-blocking SSL sockets

...@@ -1631,8 +1631,14 @@ thus several things you need to be aware of: ...@@ -1631,8 +1631,14 @@ thus several things you need to be aware of:
and :meth:`SSLSocket.send` failures, and retry after another call to and :meth:`SSLSocket.send` failures, and retry after another call to
:func:`~select.select`. :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 (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 - The SSL handshake itself will be non-blocking: the
:meth:`SSLSocket.do_handshake` method has to be retried until it returns :meth:`SSLSocket.do_handshake` method has to be retried until it returns
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment